Skip to content
Rubens de Oliveira Moraes Filho edited this page Apr 29, 2021 · 3 revisions

This command sends a number of units to collect resources.

Stand-alone application

Used as a single command, harvest sends <quantity> of workers to collect resources from the closest deposit of resources, calculated considered the current position of the units. Harvest can be interpreted (composed) as:

harvest(<quantity>)

Harvest is an action that only is performed by the Workers. To simplify the command, it only asks how many workers you want to use in the process to collect resources. By default, the workers will harvest from the closest collection point.

When one worker gets the resource from a collection point, it reduces the number of resources available in the collection point, as the pictures below illustrate. The total quantity of resources, that a player owns, is updated after the workers deliver the resource in a Base.

Used in a Loop (For)

Harvest can appear inside of a loop, however, the command can't receive a unit as a parameter, which means that this command will be used always as the stand-alone way.


In code (how to creat one)

CommandDSL ast_example = new CommandDSL("harvest(2)");

By translate method

ast_example.translate() --> print in Java console--> harvest(2)

By friendly translate method

ast_example.friendly_translate() --> print in Java console--> harvest(2)

By formated Structured DSL Tree Pre-Order Print method

BuilderDSLTreeSingleton.formatedStructuredDSLTreePreOrderPrint((iNodeDSLTree) ast_example); --> print in Java console--> c->harvest(2)

Clone this wiki locally