Skip to content

Commit 0f67e70

Browse files
author
kiwiyou
committed
Update CommandOperator.cs
1 parent 78ffbb7 commit 0f67e70

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

ClickWar2/Game/CommandOperator.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,24 @@ public CommandOperator()
586586
return 1;
587587
});
588588
SetWork("random", "rnd");
589+
590+
SetWork("divide", 3, (boardDirector, userDirector, chip, param, hereTile, herePos) =>
591+
{
592+
if (IsText(param[0]))
593+
param[0] = ToText(param[0]);
594+
595+
string result = "";
596+
if (IsInt(param[1]) && IsInt(param[2]))
597+
{
598+
int division = ToInt(param[1]) / ToInt(param[2]);
599+
result = division.ToString();
600+
}
601+
602+
this.SetVar(param[0], result);
603+
604+
return 1;
605+
});
606+
SetWork("divide", "div");
589607
}
590608

591609
//#####################################################################################

0 commit comments

Comments
 (0)