Skip to content

Commit

Permalink
Merge branch 'main' into public-release
Browse files Browse the repository at this point in the history
  • Loading branch information
TheApplePieGod committed Jan 29, 2025
2 parents 5236720 + 5193e53 commit 5198e0c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions battlecode25/engine/game/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ def run_turn(robot: Robot):
self.team_info.add_execution_time(robot.team, run_time)
if self.team_info.get_execution_time(robot.team) >= GameConstants.MAX_TEAM_EXECUTION_TIME:
self.resign(robot.team)
if robot.disintegrated:
self.destroy_robot(robot.id)

if self.running:
self.round += 1
Expand Down
1 change: 1 addition & 0 deletions battlecode25/engine/game/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def __init__(self, game: Game, id, team: Team, type: UnitType, loc: MapLocation)
self.movement_cooldown = GameConstants.COOLDOWN_LIMIT
self.runner = None
self.debug = False
self.disintegrated = False
self.message_buffer = MessageBuffer(GameConstants.MESSAGE_ROUND_DURATION)
self.sent_message_count = 0
self.has_tower_area_attacked = False
Expand Down
3 changes: 2 additions & 1 deletion battlecode25/engine/game/robot_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,8 @@ def resign(self) -> None:
self.game.resign(self.robot.team)

def disintegrate(self) -> None:
self.game.destroy_robot(self.robot.id)
self.robot.disintegrated = True
self.yield_turn()

# CLOCK METHODS

Expand Down

0 comments on commit 5198e0c

Please sign in to comment.