Creation Engine
Class for unified and consistent GameEntity creation and removal.
By 'creation' we mean adding the entity to the game world:
adding the entity to all necessary engines
sending all necessary messages
starting entity's messaging coroutine
Parameters
physics
The PhysicsEngine that will be used with this CreationEngine.
fight Engine
The FightEngine that will be used with this CreationEngine.
Constructors
Link copied to clipboard
CreationEngine CreationEngine(PhysicsEngine physics, FightEngine fightEngine)
Content copied to clipboard
Creates a CreationEngine with no entities.
Functions
Link copied to clipboard
final Unit addAllToWorld(Set<GameEntity> entities, Function0<Unit> preStartAction)
Content copied to clipboard
Adds several entities to game world at once.
Link copied to clipboard
Removes entity from game world. This method is basically an inverse of tryAddToWorld method.
Link copied to clipboard
Removes all alive entities through stopping their coroutines. Waits for stop of each coroutine.
Link copied to clipboard
Tries to add entity to the game world.