-
Notifications
You must be signed in to change notification settings - Fork 104
Move Away
This command sends units, of a specific type, to move in direction of the farthest player's base.
MoveAway sends free units of type <type>
to move in the direction of the farthest player’s base. MoveAway can be interpreted (composed) as:
If the player has more than one base in-game, the command will send the units to move in direction of the base that has the farthest euclidian distance. To define this distance the command iterate over each players' unit, and measure the current distance between the unit and each base in-game, selecting the base that has the greatest distance between the unit and the base. If the player doesn't have any base in-game, the command won't return any command for any unit. If not exists a path between the unit and the selected base, the command won't return any command, either.
Used in a Loop (For)
MoveAway can be used inside of the for structure by adding a <unit>
parameter into the parameter list. It changes the command like the example below:
When moveaway receives a <unit>
as a parameter, the command will just try to set up an action for the unit that is iterated by the loop.
CommandDSL ast_example = new CommandDSL("moveaway(Light)");
ast_example.translate()
--> print in Java console--> moveaway(Light)
ast_example.friendly_translate()
--> print in Java console--> moveaway(Light)
BuilderDSLTreeSingleton.formatedStructuredDSLTreePreOrderPrint((iNodeDSLTree) ast_example);
--> print in Java console--> c->moveaway(Light)