define unit creation policy with respect of current resources, or other factors of the board. Can the player build this unit at this moment ? (ie has sufficient resources ? ). For example: player.resources.find(r=>r.name==='gold').value>50 && player=>player.resources.find(r=>r.name==='gold')
the id of the referenced unit type or Player or whatever (IUnit)
each of this modifiers will end up in a subscription in the game and notified when requested event happen so they have the chance to modify the state somehow
define unit creation policy with respect of a place in the board
IN the case units move automatically, define movement policies - for example, can there be two units in the same box ?
if the unit moves manually (don't use the framework's automatic moves), then it returns the box where it should move this turn. If it doesn't move manually (uses the framework automatic move), then return false
in the case units attack automatically, same logic as [[unitShouldMove]] but for attacking
before automatically moving a unit, the framework ask its type if it's OK so unit type definition can customize how it moves. For allow the framework to automatically move the unit, return true (default) For moving to a custom box return that box. Notice that implementers are responsible of respecting the game rules (for example cannot move to a non-traspassable box For not moving at all, just return the same box argument.
Note: this is not about IA, this is about unit movement policy. Remember units movement and attack arer automatically users, including IA cannot decide anything about it.
Generated using TypeDoc
Define some behavior at the unit level type and unit instance level. For example, can a player buy a unit, should the unit move or attack etc