Skip to content

Commit

Permalink
Merge pull request #216 from AresSC2/refactor/new-grid-manager
Browse files Browse the repository at this point in the history
refactor: new grid manager
  • Loading branch information
raspersc2 authored Feb 16, 2025
2 parents 74c396d + 809e363 commit e26133b
Show file tree
Hide file tree
Showing 8 changed files with 1,011 additions and 833 deletions.
1 change: 1 addition & 0 deletions src/ares/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ class ManagerName(str, Enum):
DATA_MANAGER = "DataManager"
ENEMY_TO_BASE_MANAGER = "EnemyToBaseManager"
FLYING_STRUCTURE_MANAGER = "FlyingStructureManager"
GRID_MANAGER = "GridManager"
INTEL_MANAGER = "IntelManager"
PATH_MANAGER = "PathManager"
PLACEMENT_MANAGER = "PlacementManager"
Expand Down
5 changes: 3 additions & 2 deletions src/ares/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ async def on_step(self, iteration: int) -> None: # pragma: no cover

self.actual_iteration += 1
if self.chat_debug:
# trunk-ignore(mypy/unreachable)
await self.chat_debug.parse_commands()

async def _after_step(self) -> int:
Expand All @@ -387,7 +388,7 @@ async def _after_step(self) -> int:
)
for archon_morph_action in self._archon_morph_actions:
await self._do_archon_morph(archon_morph_action)
self.manager_hub.path_manager.reset_grids(self.actual_iteration)
self.manager_hub.grid_manager.reset_grids(self.actual_iteration)
await self.manager_hub.warp_in_manager.do_warp_ins()
return await super(AresBot, self)._after_step()

Expand Down Expand Up @@ -575,7 +576,7 @@ def _add_enemy_unit(
if unit_id in ENEMY_VS_GROUND_STATIC_DEFENSE_TYPES:
enemy_vs_ground_static_defense_list.append(unit_obj)
if update_managers:
self.manager_hub.path_manager.add_structure_influence(unit_obj)
self.manager_hub.grid_manager.add_structure_influence(unit_obj)
else:
self.enemy_units.append(unit_obj)
if BuffId.PARASITICBOMB in unit_obj.buffs:
Expand Down
Loading

0 comments on commit e26133b

Please sign in to comment.