stratega.EntityForwardModel
- class stratega.EntityForwardModel
Is the driving component of Stratega, with a provided gamestate it can generate a new set of available actions thanks to the
- __init__(*args, **kwargs)
Methods
__init__(*args, **kwargs)add_lose_conditions(self, conditions)Adds a list of conditions for the game to be lost for a player.
add_on_entity_spawn_effect(self, ose)Adds an OnEntitySpawnEffect to the forward mode, which will be executed every time an entity is spawned.
add_on_tick_effect(self, ote)Adds an OnTickEffect to the forward mode, which will be executed every game tick.
add_win_conditions(self, conditions)Adds a list of conditions for the game to be won for a player.
can_player_lost(self, state, player)Checks if a player has lost the game due to the game's lose conditions.
check_player_won(self, state, player)Returns if a player won the game by attending to the winning conditions defined in the rules.
get_lose_conditions(self)Returns a list of sub-lists with all LOSE conditions.
get_on_entity_spawn_effects(self)Returns all effects that are exxecuted every time an entity is spawned in the game.
get_on_tick_effects(self)Returns all effects that are exxecuted on every tick of the game.
get_win_conditions(self)Returns a list of sub-lists with all WIN conditions.
spawn_entity(self, state, entityType, ...)Spawns an entity in the game with the default spawn entity method.