Skip to content

Manager mediator

To enable communication between managers in ares-sc2, the mediator pattern is used internally. If you need to request information or perform an action from a manager, it is strongly recommended that you do so through the mediator, which can be accessed via self.mediator. For example:

ground_grid: np.ndarray = self.mediator.get_ground_grid

Mediator concrete class is the single source of truth and coordinator of communications between the managers.

Source code in src/ares/managers/manager_mediator.py
def __init__(self) -> None:
    self.managers: Dict[str, "Manager"] = {}  # noqa

get_air_avoidance_grid property

get_air_avoidance_grid

Get the air avoidance pathing grid.

PathManager

Example:

import numpy as np

avoidance_grid: np.ndarray = self.mediator.get_air_avoidance_grid

Returns:

Type Description
np.ndarray :

The air avoidance pathing grid.

get_air_grid property

get_air_grid

Get the air pathing grid.

PathManager

Example:

import numpy as np

air_grid: np.ndarray = self.mediator.get_air_grid

Returns:

Type Description
np.ndarray :

The air pathing grid.

get_air_vs_ground_grid property

get_air_vs_ground_grid

Get the air vs ground pathing grid.

PathManager

Example:

import numpy as np

air_vs_ground_grid: np.ndarray = (
    self.mediator.get_air_vs_ground_grid
)

Returns:

Type Description
np.ndarray :

The air vs ground pathing grid.

get_all_enemy property

get_all_enemy

Get all enemy units.

UnitMemoryManager

Returns:

Name Type Description
Units Units

All enemy units.

get_building_counter property

get_building_counter

Get a dictionary containing the number of each type of building in progress.

BuildingManager.

Returns:

Type Description
DefaultDict[UnitID, int] :

Number of each type of UnitID presently being tracking for building.

get_building_tracker_dict property

get_building_tracker_dict

Get the building tracker dictionary.

Building Manager.

Returns:

Type Description
Dict[int, Dict[str, Union[Point2, Unit, UnitID, float]]] :

Tracks the worker tag to: UnitID of the building to be built Point2 of where the building is to be placed In-game time when the order started Why the building is being built

get_cached_enemy_army property

get_cached_enemy_army

Get the Units object for the enemy army.

UnitCacheManager

Returns:

Name Type Description
Units Units

The enemy army.

get_cached_enemy_workers property

get_cached_enemy_workers

Get the Units object for the enemy workers.

UnitCacheManager

Returns:

Name Type Description
Units Units

The enemy workers.

get_cached_ground_grid property

get_cached_ground_grid

Get a non-influence ground pathing grid.

PathManager

Example:

import numpy as np

cached_ground_grid: np.ndarray = (
    self.mediator.get_cached_ground_grid
)

Returns:

Type Description
np.ndarray :

The clean ground pathing grid.

get_climber_grid property

get_climber_grid

Get the climber ground pathing grid for reapers and colossus.

PathManager

Example:

import numpy as np

climber_grid: np.ndarray = (
    self.mediator.get_climber_grid
)

Returns:

Type Description
np.ndarray :

The climber pathing grid.

get_defensive_third property

get_defensive_third

Get the third furthest from enemy.

TerrainManager

Returns:

Name Type Description
Point2 Point2

Location of the third base furthest from the enemy.

get_enemy_army_center_mass property

get_enemy_army_center_mass

Get the point containing the largest amount of the enemy army.

UnitCacheManager

Returns:

Name Type Description
Point2 Point2

Enemy army center mass location.

get_enemy_army_dict property

get_enemy_army_dict

Get the dictionary of enemy army unit types to the units themselves.

UnitCacheManager

Returns:

Type Description
DefaultDict[UnitID, Units] :

The dictionary of enemy army unit types to the units themselves.

get_enemy_expansions property

get_enemy_expansions

Get the expansions, as ordered from the enemy's point of view.

TerrainManager

Returns:

Type Description
List[Tuple[Point2, float]] :

List of Tuples where The first element is the location of the base. The second element is the pathing distance from the enemy main base.

get_enemy_fliers property

get_enemy_fliers

Get enemy flying units.

UnitMemoryManager

Returns:

Name Type Description
Units Units

Enemy flying units.

get_enemy_fourth property

get_enemy_fourth

Get the enemy fourth base.

TerrainManager

Returns:

Name Type Description
Point2 Point2

Location of the enemy fourth base.

get_enemy_ground property

get_enemy_ground

Get enemy ground units.

UnitMemoryManager

Returns:

Name Type Description
Units Units

Enemy ground units.

get_enemy_nat property

get_enemy_nat

Get the enemy natural expansion.

TerrainManager

Returns:

Name Type Description
Point2 Point2

Location of the enemy natural expansion.

get_enemy_ramp property

get_enemy_ramp

Get the enemy main base ramp.

TerrainManager

Returns:

Name Type Description
Ramp Ramp

sc2 Ramp object for the enemy main base ramp.

get_enemy_third property

get_enemy_third

Get the enemy third base.

TerrainManager

Returns:

Name Type Description
Point2 Point2

Location of the enemy third base.

get_enemy_tree property

get_enemy_tree

Get the KDTree representing all enemy unit positions.

UnitMemoryManager

Returns:

Name Type Description
KDTree KDTree

KDTree representing all enemy unit positions.

get_flying_enemy_near_bases property

get_flying_enemy_near_bases

Get dictionary containing flying enemy near townhalls.

EnemyToBase Manager

Returns:

Type Description
dict[int, set[int]] :

A dictionary where the integer key is a townhall tag. And the value contains a set of ints cotianing enemy tags near this base.

get_flying_structure_tracker property

get_flying_structure_tracker

Get the current information stored by FlyingStructureManager.

FlyingStructureManager

Returns:

Type Description
dict[int, Any] :

Key -> structure_tag, Value -> Information about the flight.

get_forcefield_positions property

get_forcefield_positions

Get positions of forcefields.

PathManager

Example:

from sc2.position import Point2

ff_positions: list[Point2] = self.mediator.get_forcefield_positions

Returns:

Type Description
List[Point2] :

List of the center point of forcefields.

get_ground_avoidance_grid property

get_ground_avoidance_grid

Get the ground avoidance pathing grid.

PathManager

Returns:

Type Description
np.ndarray :

The ground avoidance pathing grid.

get_ground_enemy_near_bases property

get_ground_enemy_near_bases

Get dictionary containing ground enemy near townhalls.

EnemyToBase Manager

Returns:

Type Description
dict[int, set[int]] :

A dictionary where the integer key is a townhall tag. And the value contains a set of ints cotianing enemy tags near this base.

get_ground_grid property

get_ground_grid

Get the ground pathing grid.

PathManager

Returns:

Type Description
np.ndarray :

The ground pathing grid.

get_ground_to_air_grid property

get_ground_to_air_grid

Get the ground pathing grid.

PathManager

Returns:

Type Description
np.ndarray :

The ground pathing grid.

get_initial_pathing_grid property

get_initial_pathing_grid

Get the pathing grid as it was on the first iteration.

TerrainManager

Returns:

Type Description
np.ndarray :

The pathing grid as it was on the first iteration.

get_is_free_expansion property

get_is_free_expansion

Check all bases for a free expansion.

TerrainManager

Returns:

Name Type Description
bool bool

True if there exists a free expansion, False otherwise.

get_main_air_threats_near_townhall property

get_main_air_threats_near_townhall

Get the main enemy air force near one of our bases.

EnemyToBase Manager

Returns:

Name Type Description
Units Units

The largest enemy air force near our bases.

get_main_ground_threats_near_townhall property

get_main_ground_threats_near_townhall

Get the main enemy ground force near one of our bases.

EnemyToBase Manager

Returns:

Name Type Description
Units Units

The largest enemy ground force near our bases.

get_map_choke_points property

get_map_choke_points

All the points on the map that compose choke points.

TerrainManager

Returns:

Type Description
Set[Point2] :

All the points on the map that compose choke points.

get_map_data_object property

get_map_data_object

Get the MapAnalyzer.MapData object being used.

PathManager

Returns:

Name Type Description
MapData MapData

The MapAnalyzer.MapData object being used.

get_mineral_patch_to_list_of_workers property

get_mineral_patch_to_list_of_workers

Get a dictionary containing mineral tag to worker tags

Resource Manager

Returns:

Name Type Description
dict Dict[int, Set[int]]

Dictionary where key is mineral tag, and value is workers assigned here.

get_mineral_target_dict property

get_mineral_target_dict

Get position in front of each mineral.

This position is used for speed mining, and is also useful for making sure worker is moved to the right side of a mineral.

ResourceManager

Returns:

Name Type Description
dict dict[int, Point2]

Key -> mineral tag, Value -> Position

get_num_available_mineral_patches property

get_num_available_mineral_patches

Get the number available mineral fields.

An available mineral field is one that is near a townhall and has fewer than two assigned workers.

ResourceManager

Returns:

Name Type Description
int int

Number available mineral fields.

get_ol_spot_near_enemy_nat property

get_ol_spot_near_enemy_nat

Get the overlord spot nearest to the enemy natural.

TerrainManager

Returns:

Name Type Description
Point2 Point2

Overlord spot near the enemy natural.

get_ol_spots property

get_ol_spots

High ground Overlord hiding spots.

TerrainManager

Returns:

Type Description
List[Point2] :

List of Overlord hiding spots.

get_old_own_army_dict property

get_old_own_army_dict

Get the previous iteration's own_army dict.

UnitCacheManager

Returns:

Type Description
DefaultDict[UnitID, Units] :

The dictionary of own army unit types to the units themselves.

get_own_army property

get_own_army

Get the Units object for our own army.

UnitCacheManager

Returns:

Name Type Description
Units Units

Our own army.

get_own_army_dict property

get_own_army_dict

Get the dictionary of own army unit types to the units themselves.

UnitCacheManager

Returns:

Type Description
DefaultDict[UnitID, Units] :

The dictionary of own army unit types to the units themselves.

get_own_expansions property

get_own_expansions

Get the expansions.

TerrainManager

Returns:

Type Description
List[Tuple[Point2, float]] :

List of Tuples where The first element is the location of the base. The second element is the pathing distance from our main base.

get_own_nat property

get_own_nat

Get our natural expansion.

TerrainManager

Returns:

Name Type Description
Point2 Point2

Location of our natural expansion.

get_own_structures_dict property

get_own_structures_dict

Get the dictionary of own structure types to the units themselves.

UnitCacheManager

Returns:

Type Description
DefaultDict[UnitID, Units] :

The dictionary of own structure types to the units themselves.

get_own_tree property

get_own_tree

Get the KDTree representing all friendly unit positions.

UnitMemoryManager

Returns:

Name Type Description
KDTree Units

KDTree representing all friendly unit positions.

get_positions_blocked_by_burrowed_enemy property

get_positions_blocked_by_burrowed_enemy

Build positions that are blocked by a burrowed enemy unit.

TerrainManager

Returns:

Type Description
List[Point2] :

List of build positions that are blocked by a burrowed enemy unit.

get_priority_ground_avoidance_grid property

get_priority_ground_avoidance_grid

Get the pathing grid containing things ground units should always avoid.

PathManager

Returns:

Type Description
np.ndarray :

The priority ground avoidance pathing grid.

get_removed_units property

get_removed_units

Get the units removed from memory units.

UnitCacheManager

Returns:

Name Type Description
Units Units

The units removed from memory units.

get_th_tag_with_largest_ground_threat property

get_th_tag_with_largest_ground_threat

Get the tag of our townhall with the largest enemy ground force nearby.

WARNING: This will remember the townhall tag even if enemy has gone. Do not use this to detect enemy at a base. Use get_main_ground_threats_near_townhall Or get_ground_enemy_near_bases instead

EnemyToBase Manager

Returns:

Name Type Description
Units int

The largest enemy ground force near our bases.

get_unit_role_dict property

get_unit_role_dict

Get the dictionary of UnitRole to the set of tags of units with that role.

UnitRoleManager

Returns:

Type Description
Dict[UnitRole, Set[int]] :

Dictionary of UnitRole to the set of tags of units with that role.

get_unit_to_ability_dict property

get_unit_to_ability_dict

Get a dictionary containing unit tag, to ability frame cooldowns.

AbilityTrackerManager.

Returns:

Type Description
Dict[int, Any] :

Unit tag to abilities and the next frame they can be casted.

get_whole_map_array property

get_whole_map_array

Get the list containing every point on the map.

PathManager

Notes

This does not return Point2s.

Returns:

Type Description
List[List[int]] :

Every point on the map.

get_whole_map_tree property

get_whole_map_tree

Get the KDTree of all points on the map.

PathManager

Returns:

Name Type Description
KDTree KDTree

KDTree of all points on the map.

get_worker_tag_to_townhall_tag property

get_worker_tag_to_townhall_tag

Get a dictionary containing worker tag to townhall tag. Where the townhall is the place where worker returns resources

Resource Manager

Returns:

Name Type Description
dict dict[int, int]

Dictionary where key is worker tag, and value is townhall tag.

get_worker_to_mineral_patch_dict property

get_worker_to_mineral_patch_dict

Get a dictionary containing worker tag to mineral patch tag.

Resource Manager

Returns:

Name Type Description
dict dict[int, int]

Dictionary where key is worker tag, and value is mineral tag.

get_worker_to_vespene_dict property

get_worker_to_vespene_dict

Get a dictionary containing worker tag to gas building tag.

Resource Manager

Returns:

Name Type Description
dict dict

Dictionary where key is worker tag, and value is gas building tag.

add_managers

add_managers(managers)

Generate manager dictionary.

Parameters:

Name Type Description Default
managers List[Manager]

List of all Managers capable of handling ManagerRequests.

required

Returns:

Type Description
None
Source code in src/ares/managers/manager_mediator.py
def add_managers(self, managers: List["Manager"]) -> None:  # noqa
    """Generate manager dictionary.

    Parameters
    ----------
    managers :
        List of all Managers capable of handling ManagerRequests.
    Returns
    ----------
    None
    """
    for manager in managers:
        self.managers[str(type(manager).__name__)] = manager

assign_role

assign_role(**kwargs)

Assign a unit a role.

UnitRoleManager

Parameters:

Name Type Description Default
tag int

Tag of the unit to be assigned.

required
role UnitRole

What role the unit should have.

required
remove_from_squad bool(default=True)

Attempt to remove this unit from squad bookkeeping.

required

Returns:

Type Description
None
Source code in src/ares/managers/manager_mediator.py
def assign_role(self, **kwargs) -> None:
    """Assign a unit a role.

    UnitRoleManager

    Parameters
    -----
    tag : int
        Tag of the unit to be assigned.
    role : UnitRole
        What role the unit should have.
    remove_from_squad : bool (default = True)
        Attempt to remove this unit from squad bookkeeping.

    Returns
    ----------
    None
    """
    return self.manager_request(
        ManagerName.UNIT_ROLE_MANAGER,
        ManagerRequestType.ASSIGN_ROLE,
        **kwargs,
    )

batch_assign_role

batch_assign_role(**kwargs)

Assign a given role to a List of unit tags.

Nothing more than a for loop, provided for convenience.

UnitRoleManager

Parameters:

Name Type Description Default
tags Set[int]

Tags of the units to assign to a role.

required
role UnitRole

The role the units should be assigned to.

required

Returns:

Type Description
None
Source code in src/ares/managers/manager_mediator.py
def batch_assign_role(self, **kwargs) -> None:
    """Assign a given role to a List of unit tags.

    Nothing more than a for loop, provided for convenience.

    UnitRoleManager

    Parameters
    -----
    tags : Set[int]
        Tags of the units to assign to a role.
    role : UnitRole
        The role the units should be assigned to.

    Returns
    ----------
    None
    """
    return self.manager_request(
        ManagerName.UNIT_ROLE_MANAGER,
        ManagerRequestType.BATCH_ASSIGN_ROLE,
        **kwargs,
    )

build_with_specific_worker

build_with_specific_worker(**kwargs)

Build a structure with a specific worker.

BuildingManager.

Parameters:

Name Type Description Default
worker Unit

The chosen worker.

required
structure_type UnitTypeId

What type of structure to build.

required
pos Point2

Where the structure should be placed.

required
building_purpose BuildingPurpose

Why the structure is being placed.

required

Returns:

Name Type Description
bool bool

True if a position for the building is found and the worker is valid, otherwise False

Source code in src/ares/managers/manager_mediator.py
def build_with_specific_worker(self, **kwargs) -> bool:
    """Build a structure with a specific worker.

    BuildingManager.

    Parameters
    -----
    worker : Unit
        The chosen worker.
    structure_type : UnitID
        What type of structure to build.
    pos : Point2
        Where the structure should be placed.
    building_purpose : BuildingPurpose
        Why the structure is being placed.

    Returns
    -------
    bool :
        True if a position for the building is found and the worker is valid,
        otherwise False

    """
    return self.manager_request(
        ManagerName.BUILDING_MANAGER,
        ManagerRequestType.BUILD_WITH_SPECIFIC_WORKER,
        **kwargs,
    )

building_position_blocked_by_burrowed_unit

building_position_blocked_by_burrowed_unit(**kwargs)

See if the building position is blocked by a burrowed unit.

TerrainManager

Parameters:

Name Type Description Default
worker_tag int

The worker attempting to build the structure.

required
position Point2

Where the structure is attempting to be placed.

required

Returns:

Type Description
Optional[Point2] :

The position that's blocked by an enemy unit.

Source code in src/ares/managers/manager_mediator.py
def building_position_blocked_by_burrowed_unit(self, **kwargs) -> Optional[Point2]:
    """See if the building position is blocked by a burrowed unit.

    TerrainManager

    Parameters
    ----------
    worker_tag : int
        The worker attempting to build the structure.
    position : Point2
        Where the structure is attempting to be placed.

    Returns
    -------
    Optional[Point2] :
        The position that's blocked by an enemy unit.

    """
    return self.manager_request(
        ManagerName.TERRAIN_MANAGER,
        ManagerRequestType.BUILDING_POSITION_BLOCKED_BY_BURROWED_UNIT,
        **kwargs,
    )

can_place_structure

can_place_structure(**kwargs)

Check if structure can be placed at a given position.

Faster cython alternative to python-sc2 await self.can_place()

PlacementManager

Parameters:

Name Type Description Default
position Point2

The intended building position.

required
structure_type UnitTypeId

Structure type we want to place.

required
include_addon bool

For Terran structures, check addon will place too.

required

Returns:

Name Type Description
bool bool

Indicating if structure can be placed at given position.

Source code in src/ares/managers/manager_mediator.py
def can_place_structure(self, **kwargs) -> bool:
    """Check if structure can be placed at a given position.

    Faster cython alternative to `python-sc2` `await self.can_place()`

    PlacementManager

    Parameters
    ----------
    position : Point2
        The intended building position.
    structure_type : UnitID
        Structure type we want to place.
    include_addon : bool, optional
        For Terran structures, check addon will place too.

    Returns
    ----------
    bool :
        Indicating if structure can be placed at given position.
    """
    return self.manager_request(
        ManagerName.PLACEMENT_MANAGER,
        ManagerRequestType.CAN_PLACE_STRUCTURE,
        **kwargs,
    )

can_win_fight

can_win_fight(**kwargs)

Get the predicted engagement result between two forces.

Combat Sim Manager.

Parameters:

Name Type Description Default
own_units Units

Our units involved in the battle.

required
enemy_units Units

The enemy units.

required
timing_adjust bool

Take distance between units into account.

required
good_positioning bool

Assume units are decently split.

required
workers_do_no_damage bool

Don't take workers into account.

required

Returns:

Name Type Description
EngagementResult EngagementResult

Enum with human-readable engagement result

Source code in src/ares/managers/manager_mediator.py
def can_win_fight(self, **kwargs) -> EngagementResult:
    """Get the predicted engagement result between two forces.

    Combat Sim Manager.

    Parameters
    ----------
    own_units : Units
        Our units involved in the battle.
    enemy_units : Units
        The enemy units.
    timing_adjust : bool
        Take distance between units into account.
    good_positioning : bool
        Assume units are decently split.
    workers_do_no_damage : bool
        Don't take workers into account.

    Returns
    -------
    EngagementResult :
        Enum with human-readable engagement result

    """
    return self.manager_request(
        ManagerName.COMBAT_SIM_MANAGER, ManagerRequestType.CAN_WIN_FIGHT, **kwargs
    )

clear_role

clear_role(**kwargs)

Clear a unit's role.

UnitRoleManager

Parameters:

Name Type Description Default
tag int

Tag of the unit to clear the role of.

required

Returns:

Type Description
None
Source code in src/ares/managers/manager_mediator.py
def clear_role(self, **kwargs) -> None:
    """Clear a unit's role.

    UnitRoleManager

    Parameters
    -----
    tag : int
        Tag of the unit to clear the role of.

    Returns
    ----------
    None
    """
    return self.manager_request(
        ManagerName.UNIT_ROLE_MANAGER, ManagerRequestType.CLEAR_ROLE, **kwargs
    )

find_closest_safe_spot

find_closest_safe_spot(**kwargs)

Find the closest point with the lowest cost on a grid.

PathManager

Parameters:

Name Type Description Default
from_pos Point2

Where the search starts from.

required
grid ndarray

The grid to find the low cost point on.

required
radius float

How far away the safe point can be.

required

Returns:

Name Type Description
Point2 Point2

The closest location with the lowest cost.

Source code in src/ares/managers/manager_mediator.py
def find_closest_safe_spot(self, **kwargs) -> Point2:
    """Find the closest point with the lowest cost on a grid.

    PathManager

    Parameters
    -----
    from_pos : Point2
        Where the search starts from.
    grid : np.ndarray
        The grid to find the low cost point on.
    radius : float
        How far away the safe point can be.

    Returns
    -------
    Point2 :
        The closest location with the lowest cost.

    """
    return self.manager_request(
        ManagerName.PATH_MANAGER, ManagerRequestType.GET_CLOSEST_SAFE_SPOT, **kwargs
    )

find_low_priority_path

find_low_priority_path(**kwargs)

Find several points in a path.

This way a unit can queue them up all at once for performance reasons.

i.e. running drones from a base or sending an overlord to a new position.

This does not return every point in the path. Instead, it returns points spread along the path.

PathManager

Parameters:

Name Type Description Default
start Point2

Start point of the path.

required
target Point2

Desired end point of the path.

required
grid ndarray

The grid that should be used for pathing.

required

Returns:

Type Description
List[Point2] :

List of points composing the path.

Source code in src/ares/managers/manager_mediator.py
def find_low_priority_path(self, **kwargs) -> List[Point2]:
    """Find several points in a path.

    This way a unit can queue them up all at once for performance reasons.

    i.e. running drones from a base or sending an overlord to a new position.

    This does not return every point in the path. Instead, it returns points spread
    along the path.

    PathManager

    Parameters
    ----------
    start : Point2
        Start point of the path.
    target : Point2
        Desired end point of the path.
    grid : np.ndarray
        The grid that should be used for pathing.

    Returns
    -------
    List[Point2] :
        List of points composing the path.

    """

    return self.manager_request(
        ManagerName.PATH_MANAGER,
        ManagerRequestType.FIND_LOW_PRIORITY_PATH,
        **kwargs,
    )

find_lowest_cost_points

find_lowest_cost_points(**kwargs)

Find the point(s) with the lowest cost within radius from from_pos.

PathManager

Parameters:

Name Type Description Default
from_pos Point2

Point to start the search from.

required
radius float

How far away the returned points can be.

required
grid ndarray

Which grid to query for lowest cost points.

required

Returns:

Type Description
List[Point2] :

Points with the lowest cost on the grid.

Source code in src/ares/managers/manager_mediator.py
def find_lowest_cost_points(self, **kwargs) -> List[Point2]:
    """Find the point(s) with the lowest cost within `radius` from `from_pos`.

    PathManager

    Parameters
    ----------
    from_pos : Point2
        Point to start the search from.
    radius : float
        How far away the returned points can be.
    grid : np.ndarray
        Which grid to query for lowest cost points.

    Returns
    -------
    List[Point2] :
        Points with the lowest cost on the grid.

    """
    return self.manager_request(
        ManagerName.PATH_MANAGER,
        ManagerRequestType.FIND_LOWEST_COST_POINTS,
        **kwargs,
    )

find_path_next_point

find_path_next_point(**kwargs)

Find the next point in a path.

Parameters:

Name Type Description Default
start Point2

Start point of the path.

required
target Point2

Desired end point of the path.

required
grid ndarray

The grid that should be used for pathing.

required
sensitivity int

Amount of points that should be skipped in the full path between tiles that are returned.

required
smoothing bool

Optional path smoothing where nodes are removed if it's possible to jump ahead some tiles in a straight line with a lower cost.

required
sense_danger bool

Check to see if there are any dangerous tiles near the starting point. If this is True and there are no dangerous tiles near the starting point, the pathing query is skipped and the target is returned.

required
danger_distance float

How far away from the start to look for danger.

required
danger_threshold float

Minimum value for a tile to be considered dangerous.

required

Returns:

Name Type Description
Point2 Point2

The next point in the path from the start to the target which may be the same as the target if it's safe.

Source code in src/ares/managers/manager_mediator.py
def find_path_next_point(self, **kwargs) -> Point2:
    """Find the next point in a path.

    Parameters
    ----------
    start : Point2
        Start point of the path.
    target : Point2
        Desired end point of the path.
    grid : np.ndarray
        The grid that should be used for pathing.
    sensitivity : int, optional
        Amount of points that should be skipped in the full path between tiles that
        are returned.
    smoothing : bool, optional
        Optional path smoothing where nodes are removed if it's possible to jump
        ahead some tiles in a straight line with a lower cost.
    sense_danger : bool, optional
        Check to see if there are any dangerous tiles near the starting point. If
        this is True and there are no dangerous tiles near the starting point, the
        pathing query is skipped and the target is returned.
    danger_distance : float, optional
        How far away from the start to look for danger.
    danger_threshold : float, optional
        Minimum value for a tile to be considered dangerous.

    Returns
    -------
    Point2 :
        The next point in the path from the start to the target which may be the
        same as the target if it's safe.

    """
    return self.manager_request(
        ManagerName.PATH_MANAGER, ManagerRequestType.PATH_NEXT_POINT, **kwargs
    )

find_raw_path

find_raw_path(**kwargs)

Used for finding a full path, mostly for distance checks.

PathManager

Parameters:

Name Type Description Default
start Point2

Start point of the path.

required
target Point2

Desired end point of the path.

required
grid ndarray

The grid that should be used for pathing.

required
sensitivity int

Amount of points that should be skipped in the full path between tiles that are returned.

required

Returns:

Type Description
List[Point2] :

List of points composing the path.

Source code in src/ares/managers/manager_mediator.py
def find_raw_path(self, **kwargs) -> List[Point2]:
    """Used for finding a full path, mostly for distance checks.

    PathManager

    Parameters
    ----------
    start : Point2
        Start point of the path.
    target : Point2
        Desired end point of the path.
    grid : np.ndarray
        The grid that should be used for pathing.
    sensitivity : int
        Amount of points that should be skipped in the full path between tiles that
        are returned.

    Returns
    -------
    List[Point2] :
        List of points composing the path.

    """
    return self.manager_request(
        ManagerName.PATH_MANAGER, ManagerRequestType.FIND_RAW_PATH, **kwargs
    )

get_all_from_roles_except

get_all_from_roles_except(**kwargs)

Get all units from the given roles except for unit types in excluded.

UnitRoleManager

Parameters:

Name Type Description Default
roles Set[UnitRole]

Roles to get units from.

required
excluded Set[UnitTypeId]

Unit types that should not be included.

required

Returns:

Name Type Description
Units Units

Units matching the role that are not of an excluded type.

Source code in src/ares/managers/manager_mediator.py
def get_all_from_roles_except(self, **kwargs) -> Units:
    """Get all units from the given roles except for unit types in excluded.

    UnitRoleManager

    Parameters
    -----
    roles : Set[UnitRole]
        Roles to get units from.
    excluded : Set[UnitTypeId]
        Unit types that should not be included.

    Returns
    -------
    Units :
        Units matching the role that are not of an excluded type.

    """
    return self.manager_request(
        ManagerName.UNIT_ROLE_MANAGER,
        ManagerRequestType.GET_ALL_FROM_ROLES_EXCEPT,
        **kwargs,
    )

get_behind_mineral_positions

get_behind_mineral_positions(**kwargs)

Finds 3 spots behind the mineral line

This is useful for building structures out of typical cannon range.

TerrainManager

Parameters:

Name Type Description Default
th_pos Point2

Position of townhall to find points behind the mineral line of.

required

Returns:

Type Description
List[Point2] :

Points behind the mineral line of the designated base.

Source code in src/ares/managers/manager_mediator.py
def get_behind_mineral_positions(self, **kwargs) -> List[Point2]:
    """Finds 3 spots behind the mineral line

    This is useful for building structures out of typical cannon range.

    TerrainManager

    Parameters
    ----------
    th_pos : Point2
        Position of townhall to find points behind the mineral line of.

    Returns
    -------
    List[Point2] :
        Points behind the mineral line of the designated base.

    """
    return self.manager_request(
        ManagerName.TERRAIN_MANAGER,
        ManagerRequestType.GET_BEHIND_MINERAL_POSITIONS,
        **kwargs,
    )

get_closest_overlord_spot

get_closest_overlord_spot(**kwargs)

Given a position, find the closest high ground overlord spot.

TerrainManager

Parameters:

Name Type Description Default
from_pos Point2

Position the Overlord spot should be closest to.

required

Returns:

Name Type Description
Point2 Point2

The closest Overlord hiding spot to the position.

Source code in src/ares/managers/manager_mediator.py
def get_closest_overlord_spot(self, **kwargs) -> Point2:
    """Given a position, find the closest high ground overlord spot.

    TerrainManager

    Parameters
    ----------
    from_pos : Point2
        Position the Overlord spot should be closest to.

    Returns
    -------
    Point2 :
        The closest Overlord hiding spot to the position.

    """
    return self.manager_request(
        ManagerName.TERRAIN_MANAGER,
        ManagerRequestType.GET_CLOSEST_OVERLORD_SPOT,
        **kwargs,
    )

get_flood_fill_area

get_flood_fill_area(**kwargs)

Given a point, flood fill outward from it and return the valid points.

This flood fill does not continue through chokes.

TerrainManager

Parameters:

Name Type Description Default
start_point Point2

Where to start the flood fill.

required
max_dist float

Only include points closer than this distance to the start point.

required

Returns:

Type Description
Tuple[int, List[Tuple[int, int]]] :

First element is the number of valid points. Second element is the list of all valid points.

Source code in src/ares/managers/manager_mediator.py
def get_flood_fill_area(self, **kwargs) -> set[tuple[int, int]]:
    """Given a point, flood fill outward from it and return the valid points.

    This flood fill does not continue through chokes.

    TerrainManager

    Parameters
    -----
    start_point : Point2
        Where to start the flood fill.
    max_dist : float
        Only include points closer than this distance to the start point.

    Returns
    -------
    Tuple[int, List[Tuple[int, int]]] :
        First element is the number of valid points.
        Second element is the list of all valid points.

    """
    return self.manager_request(
        ManagerName.TERRAIN_MANAGER,
        ManagerRequestType.GET_FLOOD_FILL_AREA,
        **kwargs,
    )

get_own_unit_count

get_own_unit_count(**kwargs)

Get the dictionary of own structure types to the units themselves.

UnitCacheManager

Parameters:

Name Type Description Default
unit_type_id UnitTypeId

Unit type to count.

required
include_alias bool

Check aliases. (default=True)

required

Returns:

Name Type Description
int int

Total count of this unit including aliases if specified.

Source code in src/ares/managers/manager_mediator.py
def get_own_unit_count(self, **kwargs) -> int:
    """Get the dictionary of own structure types to the units themselves.

    UnitCacheManager

    Parameters
    -----
    unit_type_id : UnitID
        Unit type to count.
    include_alias : bool
        Check aliases. (default=True)

    Returns
    -------
    int :
        Total count of this unit including aliases if specified.

    """
    return self.manager_request(
        ManagerName.UNIT_CACHE_MANAGER,
        ManagerRequestType.GET_OWN_UNIT_COUNT,
        **kwargs,
    )

get_position_of_main_squad

get_position_of_main_squad(**kwargs)

Given a unit role, find where the main squad is.

SquadManager

Parameters:

Name Type Description Default
role UnitRole

Get the squads for this unit role.

required

Returns:

Name Type Description
Point2 Point2
Source code in src/ares/managers/manager_mediator.py
def get_position_of_main_squad(self, **kwargs) -> Point2:
    """Given a unit role, find where the main squad is.

    SquadManager

    Parameters
    ----------
    role : UnitRole
        Get the squads for this unit role.

    Returns
    -------
    Point2 :

    """
    return self.manager_request(
        ManagerName.SQUAD_MANAGER,
        ManagerRequestType.GET_POSITION_OF_MAIN_SQUAD,
        **kwargs,
    )

get_squads

get_squads(**kwargs)

Given a unit role, get the updated squads.

SquadManager

Parameters:

Name Type Description Default
role UnitRole

Get the squads for this unit role.

required
squad_radius float(default=11.0)

The threshold as to which separate squads are formed.

required
unit_type

If specified, only form squads with these unit types WARNING: Will not remove units that have already been assigned to a squad.

required

Returns:

Type Description
List[UnitSquad] :

Each squad with this unit role.

Source code in src/ares/managers/manager_mediator.py
def get_squads(self, **kwargs) -> list["UnitSquad"]:
    """Given a unit role, get the updated squads.

    SquadManager

    Parameters
    ----------
    role : UnitRole
        Get the squads for this unit role.
    squad_radius : float (default = 11.0)
        The threshold as to which separate squads are formed.
    unit_type: Optional[Union[UnitID, set[UnitID]]] (default = None)
        If specified, only form squads with these unit types
        WARNING: Will not remove units that have already
                 been assigned to a squad.

    Returns
    -------
    List[UnitSquad] :
        Each squad with this unit role.

    """
    return self.manager_request(
        ManagerName.SQUAD_MANAGER,
        ManagerRequestType.GET_SQUADS,
        **kwargs,
    )

get_units_from_role

get_units_from_role(**kwargs)

Get a Units object containing units with a given role.

If a UnitID or set of UnitIDs are given, it will only return units of those types, otherwise it will return all units with the role. If restrict_to is specified, it will only retrieve units from that object.

UnitRoleManager

Parameters:

Name Type Description Default
role UnitRole

Role to get units from.

required
unit_type UnitTypeId

Type(s) of units that should be returned. If omitted, all units with the role will be returned.

required
restrict_to Set[UnitTypeId]

If supplied, only take Units with the given role and type if they also exist here.

required

Returns:

Name Type Description
Units Units

Units with the given role.

Source code in src/ares/managers/manager_mediator.py
def get_units_from_role(self, **kwargs) -> Units:
    """Get a Units object containing units with a given role.

    If a UnitID or set of UnitIDs are given, it will only return units of those
    types, otherwise it will return all units with the role. If `restrict_to` is
    specified, it will only retrieve units from that object.

    UnitRoleManager

    Parameters
    ----------
    role : UnitRole
        Role to get units from.
    unit_type : UnitTypeId
        Type(s) of units that should be returned. If omitted, all units with the
        role will be returned.
    restrict_to : Set[UnitTypeId]
        If supplied, only take Units with the given role and type if they also exist
        here.

    Returns
    -------
    Units :
        Units with the given role.

    """
    return self.manager_request(
        ManagerName.UNIT_ROLE_MANAGER,
        ManagerRequestType.GET_UNITS_FROM_ROLE,
        **kwargs,
    )

get_units_from_roles

get_units_from_roles(**kwargs)

Get the units matching unit_type from the given roles.

UnitRoleManager

Parameters:

Name Type Description Default
roles Set[UnitRole]

Roles to get units from.

required
unit_type UnitTypeId

Type(s) of units that should be returned. If omitted, all units with the role will be returned.

required

Returns:

Name Type Description
Units Units

Units with the given roles.

Source code in src/ares/managers/manager_mediator.py
def get_units_from_roles(self, **kwargs) -> Units:
    """Get the units matching `unit_type` from the given roles.

    UnitRoleManager

    Parameters
    -----
    roles : Set[UnitRole]
        Roles to get units from.
    unit_type : UnitTypeId
        Type(s) of units that should be returned. If omitted, all units with the
        role will be returned.

    Returns
    -------
    Units :
        Units with the given roles.
    """
    return self.manager_request(
        ManagerName.UNIT_ROLE_MANAGER,
        ManagerRequestType.GET_UNITS_FROM_ROLES,
        **kwargs,
    )

get_units_from_tags

get_units_from_tags(**kwargs)

Get a list of Unit objects corresponding to the given tags.

UnitCacheManager

Parameters:

Name Type Description Default
tags Set[int]

Tags of the units to retrieve.

required

Returns:

Type Description
None
Source code in src/ares/managers/manager_mediator.py
def get_units_from_tags(self, **kwargs) -> List[Unit]:
    """Get a `list` of `Unit` objects corresponding to the given tags.

    UnitCacheManager

    Parameters
    -----
    tags : Set[int]
        Tags of the units to retrieve.

    Returns
    ----------
    None
    """
    return self.manager_request(
        ManagerName.UNIT_CACHE_MANAGER,
        ManagerRequestType.GET_UNITS_FROM_TAGS,
        **kwargs,
    )

get_units_in_range

get_units_in_range(**kwargs)

Get units in range of other units or points.

UnitMemoryManager

Parameters:

Name Type Description Default
start_points

List of Units or positions to search for units from.

required
distances

How far away from each point to query. Must broadcast to the length of start_points

required
query_tree

Which KDTree should be queried.

required
return_as_dict

Sets whether the returned units in range should be a dictionary or list.

required

Returns:

Type Description
Union[Dict[Union[int, Tuple[float, float]], Units], List[Units]] :

Returns the units in range of each start point as a dict where the key is the unit tag or position and the value is the Units in range or a list of Units.

Source code in src/ares/managers/manager_mediator.py
def get_units_in_range(
    self, **kwargs
) -> Union[Dict[Union[int, Tuple[float, float]], Units], List[Units]]:
    """Get units in range of other units or points.

    UnitMemoryManager

    Parameters
    -----
    start_points: List[Union[Unit, Tuple[float, float]]]
        List of `Unit`s or positions to search for units from.
    distances: Union[float, List[float]]
        How far away from each point to query. Must broadcast to the length of
        `start_points`
    query_tree: UnitTreeQueryType
        Which KDTree should be queried.
    return_as_dict: bool = False
        Sets whether the returned units in range should be a dictionary or list.

    Returns
    -------
    Union[Dict[Union[int, Tuple[float, float]], Units], List[Units]] :
        Returns the units in range of each start point as a `dict` where the key
        is the unit tag or position and the value is the `Units` in range or a
        `list` of `Units`.

    """
    return self.manager_request(
        ManagerName.UNIT_MEMORY_MANAGER,
        ManagerRequestType.GET_UNITS_IN_RANGE,
        **kwargs,
    )

is_position_safe

is_position_safe(**kwargs)

Check if the given position is considered dangerous.

PathManager

Parameters:

Name Type Description Default
grid ndarray

The grid to evaluate safety on.

required
position Point2

The position to check the safety of.

required
weight_safety_limit float

The maximum value the point can have on the grid to be considered safe.

required

Returns:

Name Type Description
bool bool

True if the position is considered safe, False otherwise.

Source code in src/ares/managers/manager_mediator.py
def is_position_safe(self, **kwargs) -> bool:
    """Check if the given position is considered dangerous.

    PathManager

    Parameters
    ----------
    grid : np.ndarray
        The grid to evaluate safety on.
    position : Point2
        The position to check the safety of.
    weight_safety_limit : float
        The maximum value the point can have on the grid to be considered safe.

    Returns
    -------
    bool:
        True if the position is considered safe, False otherwise.

    """
    return self.manager_request(
        ManagerName.PATH_MANAGER,
        ManagerRequestType.IS_POSITION_SAFE,
        **kwargs,
    )

manager_request

manager_request(receiver, request, reason=None, **kwargs)

Function to request information from a manager.

Parameters:

Name Type Description Default
receiver ManagerName

Manager receiving the request.

required
request ManagerRequestType

Requested attribute/function call.

required
reason str

Why the request is being made.

None
kwargs

Keyword arguments (if any) to be passed to the requested function.

{}

Returns:

Name Type Description
Any Any

There are too many possible return types to list all of them.

Source code in src/ares/managers/manager_mediator.py
def manager_request(
    self,
    receiver: ManagerName,
    request: ManagerRequestType,
    reason: str = None,
    **kwargs
) -> Any:
    """Function to request information from a manager.

    Parameters
    ----------
    receiver :
        Manager receiving the request.
    request :
        Requested attribute/function call.
    reason :
        Why the request is being made.
    kwargs :
        Keyword arguments (if any) to be passed to the requested function.

    Returns
    -------
    Any :
        There are too many possible return types to list all of them.

    """
    return self.managers[receiver.value].manager_request(
        receiver, request, reason, **kwargs
    )

move_structure

move_structure(**kwargs)

Request a structure to move via flight.

FlyingStructureManager

Parameters:

Name Type Description Default
structure Unit

Our units involved in the battle.

required
target Point2

The enemy units.

required
should_land bool

Take distance between units into account.

required

Returns:

Type Description
None
Source code in src/ares/managers/manager_mediator.py
def move_structure(self, **kwargs) -> None:
    """Request a structure to move via flight.

    FlyingStructureManager

    Parameters
    ----------
    structure : Unit
        Our units involved in the battle.
    target : Point2
        The enemy units.
    should_land : bool, optional
        Take distance between units into account.

    Returns
    ----------
    None
    """
    return self.manager_request(
        ManagerName.FLYING_STRUCTURE_MANAGER,
        ManagerRequestType.MOVE_STRUCTURE,
        **kwargs,
    )

remove_gas_building

remove_gas_building(**kwargs)

Request for a gas building to be removed from bookkeeping.

Resource Manager

Parameters:

Name Type Description Default
gas_building_tag int

The tag of the gas building to remove.

required

Returns:

Type Description
None
Source code in src/ares/managers/manager_mediator.py
def remove_gas_building(self, **kwargs) -> None:
    """Request for a gas building to be removed from bookkeeping.

    Resource Manager

    Parameters
    -----
    gas_building_tag : int
        The tag of the gas building to remove.

    Returns
    ----------
    None
    """
    return self.manager_request(
        ManagerName.RESOURCE_MANAGER,
        ManagerRequestType.REMOVE_GAS_BUILDING,
        **kwargs,
    )

remove_mineral_field

remove_mineral_field(**kwargs)

Request for a mineral field to be removed from bookkeeping.

Resource Manager

Parameters:

Name Type Description Default
mineral_field_tag int

The tag of the patch to remove.

required

Returns:

Type Description
None
Source code in src/ares/managers/manager_mediator.py
def remove_mineral_field(self, **kwargs) -> None:
    """Request for a mineral field to be removed from bookkeeping.

    Resource Manager

    Parameters
    -----
    mineral_field_tag : int
        The tag of the patch to remove.

    Returns
    ----------
    None
    """
    return self.manager_request(
        ManagerName.RESOURCE_MANAGER,
        ManagerRequestType.REMOVE_MINERAL_FIELD,
        **kwargs,
    )

remove_tag_from_squads

remove_tag_from_squads(**kwargs)

Squad Manager Keyword args: tag: int

Source code in src/ares/managers/manager_mediator.py
def remove_tag_from_squads(self, **kwargs) -> None:
    """
    Squad Manager
    Keyword args:
        tag: int
    """
    return self.manager_request(
        ManagerName.SQUAD_MANAGER,
        ManagerRequestType.REMOVE_TAG_FROM_SQUADS,
        **kwargs,
    )

remove_worker_from_mineral

remove_worker_from_mineral(**kwargs)

Remove worker from internal data structures.

This happens if worker gets assigned to do something else

ResourceManager

Parameters:

Name Type Description Default
worker_tag int

Tag of the worker to be removed.

required

Returns:

Type Description
None
Source code in src/ares/managers/manager_mediator.py
def remove_worker_from_mineral(self, **kwargs) -> None:
    """Remove worker from internal data structures.

    This happens if worker gets assigned to do something else

    ResourceManager

    Parameters
    ----------
    worker_tag : int
        Tag of the worker to be removed.

    Returns
    ----------
    None
    """
    return self.manager_request(
        ManagerName.RESOURCE_MANAGER,
        ManagerRequestType.REMOVE_WORKER_FROM_MINERAL,
        **kwargs,
    )

request_building_placement

request_building_placement(**kwargs)

Request a building placement from the precalculated building formation.

PlacementManager

Parameters:

Name Type Description Default
base_location Point2

The general area where the placement should be near. This should be a expansion location.

required
structure_type UnitTypeId

Structure type requested.

required
wall bool

Request a wall structure placement. Will find alternative if no wall placements available.

required
find_alternative bool, optional (NOT YET IMPLEMENTED)

If no placements available at base_location, find alternative at nearby base.

required
reserve_placement bool

Reserve this booking for a while, so another customer doesnt request it.

required
within_psionic_matrix bool

Protoss specific -> calculated position have power?

required
closest_to Optional[Point2]
required

Returns:

Name Type Description
bool Optional[Point2]

Indicating if structure can be placed at given position.

Source code in src/ares/managers/manager_mediator.py
def request_building_placement(self, **kwargs) -> Optional[Point2]:
    """Request a building placement from the precalculated building formation.

    PlacementManager

    Parameters
    ----------
    base_location : Point2
        The general area where the placement should be near.
        This should be a expansion location.
    structure_type : UnitID
        Structure type requested.
    wall : bool, optional
        Request a wall structure placement.
        Will find alternative if no wall placements available.
    find_alternative : bool, optional (NOT YET IMPLEMENTED)
        If no placements available at base_location, find
        alternative at nearby base.
    reserve_placement : bool, optional
        Reserve this booking for a while, so another customer doesnt
        request it.
    within_psionic_matrix : bool, optional
        Protoss specific -> calculated position have power?
    closest_to : Optional[Point2]

    Returns
    ----------
    bool :
        Indicating if structure can be placed at given position.
    """
    return self.manager_request(
        ManagerName.PLACEMENT_MANAGER,
        ManagerRequestType.REQUEST_BUILDING_PLACEMENT,
        **kwargs,
    )

select_worker

select_worker(**kwargs)

Select a worker via the ResourceManager.

This way we can select one assigned to a far mineral patch. Make sure to change the worker role once selected, otherwise it will be selected to mine again. This doesn't select workers from geysers, so make sure to remove workers from gas if low on workers.

ResourceManager

Parameters:

Name Type Description Default
target_position Point2

Location to get the closest workers to.

required
force_close bool

Select the available worker closest to target_position if True.

required
select_persistent_builder bool

If True we can select the persistent_builder if it's available.

required
only_select_persistent_builder bool

If True, don't find an alternative worker

required
min_health_perc float(optional)
required

Returns:

Type Description
Optional[Unit] :

Selected worker, if available.

Source code in src/ares/managers/manager_mediator.py
def select_worker(self, **kwargs) -> Optional[Unit]:
    """Select a worker via the ResourceManager.

    This way we can select one assigned to a far mineral patch.
    Make sure to change the worker role once selected, otherwise it will be selected
    to mine again. This doesn't select workers from geysers, so make sure to remove
    workers from gas if low on workers.

    ResourceManager

    Parameters
    ----------
    target_position : Point2
        Location to get the closest workers to.
    force_close : bool
        Select the available worker closest to `target_position` if True.
    select_persistent_builder : bool
        If True we can select the persistent_builder if it's available.
    only_select_persistent_builder : bool
        If True, don't find an alternative worker
    min_health_perc : float (optional)

    Returns
    -------
    Optional[Unit] :
        Selected worker, if available.

    """
    return self.manager_request(
        ManagerName.RESOURCE_MANAGER,
        ManagerRequestType.SELECT_WORKER,
        **kwargs,
    )

set_workers_per_gas

set_workers_per_gas(**kwargs)

Give all units in a role a different role.

ResourceManager

Parameters:

Name Type Description Default
amount int

Num workers to assign to each gas building

required

Returns:

Type Description
None
Source code in src/ares/managers/manager_mediator.py
def set_workers_per_gas(self, **kwargs) -> None:
    """Give all units in a role a different role.

    ResourceManager

    Parameters
    ----------
    amount : int
        Num workers to assign to each gas building

    Returns
    ----------
    None
    """
    return self.manager_request(
        ManagerName.RESOURCE_MANAGER,
        ManagerRequestType.SET_WORKERS_PER_GAS,
        **kwargs,
    )

switch_roles

switch_roles(**kwargs)

Give all units in a role a different role.

UnitRoleManager

Parameters:

Name Type Description Default
from_role UnitRole

Role the units currently have.

required
to_role UnitRole

Role to assign to the units.

required

Returns:

Type Description
None
Source code in src/ares/managers/manager_mediator.py
def switch_roles(self, **kwargs) -> None:
    """Give all units in a role a different role.

    UnitRoleManager

    Parameters
    -----
    from_role : UnitRole
        Role the units currently have.
    to_role : UnitRole
        Role to assign to the units.

    Returns
    ----------
    None
    """
    return self.manager_request(
        ManagerName.UNIT_ROLE_MANAGER,
        ManagerRequestType.SWITCH_ROLES,
        **kwargs,
    )

update_unit_to_ability_dict

update_unit_to_ability_dict(**kwargs)

Update tracking to reflect ability usage.

After a unit uses an ability it should call this to update the frame the ability will next be available

AbilityTrackerManager.

Parameters:

Name Type Description Default
ability AbilityId

The AbilityId that was used.

required
unit_tag int

The tag of the Unit that used the ability

required

Returns:

Type Description
None
Source code in src/ares/managers/manager_mediator.py
def update_unit_to_ability_dict(self, **kwargs):
    """Update tracking to reflect ability usage.

    After a unit uses an ability it should call this to update the frame the
    ability will next be available

    AbilityTrackerManager.

    Parameters
    ----------
    ability : AbilityId
        The AbilityId that was used.
    unit_tag : int
        The tag of the Unit that used the ability

    Returns
    ----------
    None

    """
    return self.manager_request(
        ManagerName.ABILITY_TRACKER_MANAGER,
        ManagerRequestType.UPDATE_UNIT_TO_ABILITY_DICT,
        **kwargs,
    )