11Economy
22======= 
33
4+ Recipes And Constructions
5+ ------------------------- 
6+ 
47Resources are mined from deposits, or processed from other resources.
5- Producing units or  researching upgrades works the same way  as recipes.
8+ Producing units and  researching upgrades works the same as recipes.
69
710.. tab-set ::
811   :sync-group:  language
@@ -15,14 +18,14 @@ Producing units or researching upgrades works the same way as recipes.
1518          #  find closest viable position for miner: 
1619          p =  uw_world.find_construction_placement(DRILL_CONSTRUCTION_ID , home_position, METAL_RECIPE_ID ) #  recipe id is optional 
1720          if  p ==  INVALID : 
18-             return  
21+                return  
1922
2023          #  place construction: 
21-           uw_commands.place_construction(DRILL_CONSTRUCTION_ID , p, 0 , METAL_RECIPE_ID , UwPriorityEnum.Normal ) #  yaw, recipe, and priority are optional 
24+           uw_commands.place_construction(DRILL_CONSTRUCTION_ID , p, 0 , METAL_RECIPE_ID , Priority.High ) #  yaw, recipe, and priority are optional 
2225           
2326          #  recipe and priority can be changed later: 
2427          uw_commands.set_recipe(own_id, ANOTHER_RECIPE_ID ) 
25-           uw_commands.set_priority(own_id, UwPriorityEnum.High ) 
28+           uw_commands.set_priority(own_id, Priority.Normal ) 
2629
2730    .. tab-item :: C# 
2831      :sync:  csharp
@@ -32,14 +35,14 @@ Producing units or researching upgrades works the same way as recipes.
3235          //  find closest viable position for miner: 
3336           uint  p  =  World .FindConstructionPlacement (DRILL_CONSTRUCTION_ID , homePosition , METAL_RECIPE_ID ); //  recipe id is optional
3437           if  (p  ==  Entity .Invalid ): 
35-             return ; 
38+                return ; 
3639
3740          //  place construction: 
38-            Commands .PlaceConstruction (DRILL_CONSTRUCTION_ID , p , 0 , METAL_RECIPE_ID , Interop . UwPriorityEnum .Normal ); //  yaw, recipe, and priority are optional
41+            Commands .PlaceConstruction (DRILL_CONSTRUCTION_ID , p , 0 , METAL_RECIPE_ID , UwPriorityEnum .High ); //  yaw, recipe, and priority are optional
3942           
4043          //  recipe and priority can be changed later: 
41-            Commands .SetRecipe (own_id , ANOTHER_RECIPE_ID )
42-           Commands .SetPriority (own_id ,  Interop . UwPriorityEnum .High ) 
44+            Commands .SetRecipe (ownId , ANOTHER_RECIPE_ID )
45+           Commands .SetPriority (ownId ,  UwPriorityEnum .Normal ) 
4346
4447    .. tab-item :: C++ 
4548      :sync:  cpp
@@ -48,12 +51,21 @@ Producing units or researching upgrades works the same way as recipes.
4851
4952          // todo 
5053
54+  Destroyed Buildings
55+ ^^^^^^^^^^^^^^^^^^^ 
56+ 
57+ When a building is destroyed, same construction is automatically placed in its place.
58+ It has ``disabled `` priority, you just change it when appropriate.
59+ Its previous recipe is also restored.
60+ 
5161Logistics
5262--------- 
5363
5464Resources are automatically transported by trucks.
5565They will fulfill tasks by their priority, and on first-come-first-serve basis.
5666
67+ Priorities apply to both constructions and recipes.
68+ 
5769.. tab-set ::
5870   :sync-group:  language
5971
@@ -73,9 +85,35 @@ They will fulfill tasks by their priority, and on first-come-first-serve basis.
7385          //  percentage of trucks that are idle: 
7486           100 . 0  *  World .MyForceStatistics ().logisticsUnitsIdle  /  World .MyForceStatistics ().logisticsUnitsTotal 
7587
88+  Expansion Bases
89+ --------------- 
90+ 
91+ Each map contains predefined set of starting positions.
92+ These can have some additional conditions to be used as starting base, eg. actual number of forces in the game.
93+ Anyway, these positions can be used to easily find suitable expansion bases.
94+ 
95+ .. tab-set ::
96+    :sync-group:  language
97+ 
98+    .. tab-item :: Python 
99+       :sync:  python
100+ 
101+       .. code-block :: python 
102+ 
103+           #  potential expansion bases: 
104+           list ({p.position for  p in  uw_map.starting_positions()}) #  make the positions unique 
105+ 
106+     .. tab-item :: C# 
107+       :sync:  csharp
108+ 
109+       .. code-block :: csharp 
110+ 
111+           //  potential expansion bases: 
112+            Map .StartingPositions ().Select (p  =>  p .position ).Distinct ().ToList ();
113+ 
76114    .. tab-item :: C++ 
77115      :sync:  cpp
78116
79117      .. code-block :: cpp 
80118
81-           // nothing  
119+           // todo  
0 commit comments