Proxy definition¶
Map proxy¶
-
class
OrodaelTurrim.Business.Proxy.
MapProxy
(game_engine: GameEngine)[source] -
compute_accessible_tiles
(position: Position, actions: int) → Optional[Dict[Position, int]][source] Computes map with accessible tiles as keys and remaining action points as values from specified position and number of remaining action points
Parameters: - position – Position to use as base point of computation
- actions – Number of action points to consider for computation
Returns: Dict with accessible tiles as keys and remaining action points as values None if positions is not on map
-
compute_visible_tiles
(position: Position, sight: int) → Optional[Set[Position]][source] Computes set of visible tiles in sight radius from given position.
Parameters: - position – Position to use as base point of computation
- sight – Value of sight to consider for computation
Returns: Set of visible tiles of specified game object. None if positions is not on map
-
get_bases_positions
() → Set[Position][source] Retrieves positions of defenders’ bases
Returns: Positions of defenders’ bases
-
get_border_tiles
() → Set[Position][source] Retrieves set of tiles on the edge of game map
-
get_inner_tiles
() → Set[Position][source] Retrieves set of tiles which are not on the map edge
-
get_map_height
() → int[source] Retrieves number of tiles in each column of game map
-
get_map_width
() → int[source] Retrieves number of tiles in each row of game map
-
get_player_visible_tiles
() → Set[Position][source] Retrieves set of visible tiles for player.
Returns: Set of visible tiles
-
get_terrain_type
(position: Position) → Optional[TerrainType][source] Retrieves terrain type of given position Return None if Positions is not on map
Parameters: position – Position to get terrain type for Returns: Terrain type of given position
-
is_position_occupied
(position: Position) → bool[source] Checks whether given position is occupied or not. You can check only visible positions
Parameters: position – Position to be checked Returns: True in case there is game object on given position, False otherwise, None if user did not see the position
-
is_position_on_map
(position: Position) → bool[source] Checks whether given position is on map or not
Parameters: position – Position to be checked Returns: True in case position is within map bounds, False otherwise
-
player_have_base
(player: PlayerTag) → bool[source] Check if player already have a base
Parameters: player – Target player to be checked Returns: True if player have base, False otherwise
-
Game Object Proxy¶
-
class
OrodaelTurrim.Business.Proxy.
GameObjectProxy
(game_engine: GameEngine)[source] -
get_active_effects
(position: Position) → Optional[Dict[EffectType, int]][source] Retrieves types of currently active effects and their durations on game object on specified position
Parameters: position – Position of queried game object Returns: Dict of types of active effects and associated remaining durations None if there is no unit at the position or you don’‘t see that position
-
get_attack_effects
(position: Position) → Optional[Set[EffectType]][source] Retrieves the types of effect to be applied to the target of attack of game object on specified position
Parameters: position – Position of queried game object Returns: Set of types of effect to be applied upon attacking None if there is no unit at the position or you don’t see that position
-
get_attribute
(position: Position, attribute_type: AttributeType) → Optional[float][source] Retrieves value of specified attribute of game object on specified position
Parameters: - position – Position of queried game object
- attribute_type – Type of attribute to be retrieved
Returns: Value of specified attribute None if there is no unit at the position
-
get_current_hit_points
(position: Position) → Optional[float][source] Retrieves amount of currently remaining hit points of game object on specified position
Parameters: position – Position of queried game object Returns: Amount of currently remaining hit points None if there is no unit at the position or you don’t see that position
-
get_current_round
() → int[source] Returns:
-
get_income
(player: PlayerTag) → int[source] Retrieves income of given player
Parameters: player – Player whose income should be obtained Returns: Current income of given player None if player not registered
-
get_object_type
(position: Position) → Optional[GameObjectType][source] Retrieves the type of game object on the specified position. The player must see that position. This function could be used to get enemy types.
Parameters: position – Position of queried game object Returns: Type of game object on specified position GameObjectType.NONE if there is no unit at the position None if player don’t see that position
-
get_resistances
(position: Position) → Optional[Set[EffectType]][source] Retrieves the types of effect which will NOT affect game object on specified position
Parameters: position – Position of queried game object Returns: Set of resistances of game object on specified position None if there is no unit at the position or player don’t see that position
-
get_resources
(player: PlayerTag) → int[source] Retrieves current resources of given player
Parameters: player – Player whose resources should be obtained Returns: Current resources of given player None if player not registered
-
get_role
(position: Position) → GameRole[source] Retrieves the role of game object on specified position
Parameters: position – Position of queried game object Returns: Role of game object on specified position GameRole.NEUTRAL if there is no unit at the position, None if you don’t see that position
-
get_visible_enemies
(position: Position) → Optional[Dict[Position, int]][source] Retrieves map of distances to currently visible enemies by game object on specified position
Parameters: position – Position of queried game object Returns: Dictionary of visible position with enemy as a Kye and distance as a value Return None if there is no unit at the position, None if you don’t see target position
-
get_visible_tiles
(position: Position) → Optional[Set[Position]][source] Retrieves set of currently visible tiles of game object on specified position
Parameters: position – Position of queried game object Returns: Set of currently visible tiles None if there is no unit at the position, None if you don’t see target position
-
Game Control Proxy¶
-
class
OrodaelTurrim.Business.Proxy.
GameControlProxy
(game_engine: GameEngine)[source] -
spawn_unit
(information: SpawnInformation) → None[source] Attempts to spawn unit based on given spawn information
Parameters: information – Information bundle describing spawned unit Raise: IllegalActionException if invalid spawn attempt
-
Game Uncertainty Proxy¶
-
class
OrodaelTurrim.Business.Proxy.
GameUncertaintyProxy
(game_engine: GameEngine)[source] -
spawn_information
() → List[List[UncertaintySpawn]][source] - Get spawn information from uncertainty module.First level is rounds, where 0 is the nearest roundSecond level is list of UncertaintySpawn classes
Returns: Spawn information from Uncertainty module
-