There should be some behaviors that would be executed following some sort of external trigger.
Current implementations:
morphs have always active behaviors, activable behaviors, alternate behaviors
ships have always active behaviors
A behavior is only and always executed if it's active. Activable behaviors are only and always active if their owner is active.
Behaviors are executed when the owner is updated.
There is no scheduling of behaviors.
List of behaviors :
Propulsing (morph defining behavior)
PropulsorsLost
Stemming (morph defining behavior)
Morph.EnergyDiffusing
Evolving
LaserFiring (morph defining behavior)
Mining (morph defining behavior)
Ship.EnergyDiffusing
Ship.GettingEnergyFromSources
Solution :
Executing behaviors separately from the morphs and the ships in a fixed order
Using a mecanism of listeners and publishers to allow to register to a certain event from a certain type of source.
For instance, there should be something listening to the fact that a morph looses its last propulsor to add a propulsorslost behavior
The Ship.EnergyDiffusing should be aware of energy overflow from all morphs of a ship.
In fact, we need some kind of ESB
There should be some behaviors that would be executed following some sort of external trigger.
Current implementations:
Behaviors are executed when the owner is updated. There is no scheduling of behaviors.
List of behaviors :
Solution :