-
Notifications
You must be signed in to change notification settings - Fork 104
General Information
One important piece of information, about how the framework work, consists of script execution and how the script is executed. To explain the execution process, see this script:
This example describes a simple Worker Rush strategy. This textual presentation shown above uses the print method called translate (see Print AST for complementary information). Below, there is a code version to create the same structure using the AST scheme:
line 1. CommandDSL p1 = new CommandDSL("harvest(1)");
line 2. CommandDSL p2 = new CommandDSL("train(Worker,100,EnemyDir)");
line 3. CommandDSL p3 = new CommandDSL("attack(Worker,closest)");
line 4. CDSL C = new CDSL(p1, new CDSL(p2, new CDSL(p3)));
line 5. S1DSL root = new S1DSL(C);
The script composed in the picture above has 3 commands: Harvest, Train, and Attack. In normal conditions, these commands are executed as the scheme suggests in an 8x8 map:
Let's imagine a situation where the map doesn't have any resources to be harvested. The execution of the script will be as follow:
These two examples introduce how the scripts are executed by the framework.