-
Notifications
You must be signed in to change notification settings - Fork 104
Build
This command is responsible for build structures as Base and Barracks.
Used as a single command, build sends free units (units that have not received actions) to build a <quantity>
of structures of type <type>
in the cell located on the <direction>
next to the unit. Build can be interpreted (composed) as:
The option Type defines if you want to build a Base or a Barrack. The command will try to build how many structures the quantity parameter defines, considering how many resources your player has. The option direction is based on the position of the worker that will be selected to perform the action. The picture below shows one worker building a Barrack in the UP direction.
Combined with Loop (For)
Build can be used inside of the for structure by adding a <unit>
parameter into the parameter list. It changes the command as the example below:
When build receives a <unit>
as a parameter, the command will try to use the specified unit to construct a new structure of the type defined by <type>
. If the build command is able to set up the action for the specific unit, it will return a command for the unit. If not, any action will be returned.
CommandDSL ast_example = new CommandDSL("build(Base,1,Down)");
ast_example.translate()
--> print in Java console--> build(Base,1,Down)
ast_example.friendly_translate()
--> print in Java console--> build(Base,1,Down)
BuilderDSLTreeSingleton.formatedStructuredDSLTreePreOrderPrint((iNodeDSLTree) ast_example); --> print in Java console--> c->build(Base,1,Down)