The commands ensure that all modifications are recorded in the gamemap, which servers several purposes:
A Command is a top level command from the user to some building, vehicle of something. A user never issues normal GameAction The Command may need to do some lower-level modifications of the map, which are governed by the game machanis.
Here is a (simplified) example, showing what happens if the user wants to move a tank from one field to a neighbouring field. A MoveUnitCommand object is created, which will then create lots of child GameAction objects, breaking all the map modifications down into atomic actions.
MoveUnitCommand
+ Unregister unit from starting field (Action: UnitFieldRegistration)
+ put a track object on departing field (Action: SpawnObject)
[display animation of moving tank]
+ put a track object on destination field (Action: SpawnObject)
+ Register unit on destination field (Action: UnitFieldRegistration)
+ consume fuel for movement (Action: ConsumeResource)
[an enemy unit start reactionfire]
+ attack Tank with EnemyUnit
++ Enemy unit consumes one piece of ammo (Action: ConsumeAmmo)
++ Enemy unit gets experience (Action: ChangeUnitProperty)
++ Tank is damaged (Action: ChangeUnitProperty)
[ damage is 100%, so our Tank is destroyed ]
+++ Tank is destroyed and deleted from map (Action: DestructContainer)
++++ Wrackage object is created (Action: SpawnObject)
+ View is recalculated (Action: ViewRegistration)
1.5.1