Alright this is nothing fantastic but I made it quickly cause I was extremely bored XD
Code:
internal class CalculateCommand : Command
{
public CalculateCommand()
: base("calculate", 0)
{
}
protected override bool Process(Player player, RealmTime time, string[] args)
{
int first = int.Parse(args[0]);
var symbol = string.Join(" ", args[1]);
int second = int.Parse(args[2]);
int answer = 0;
if (symbol == "+")
{
answer = first + second;
}
if (symbol == "*")
{
answer = first * second;
}
if (symbol == "-")
{
answer = first - second;
}
if (symbol == "/")
{
answer = first / second;
}
player.SendInfo(answer.ToString());
return true;
}
}