Add game.kill_team; attemp to fix #11
release-tag / release-image (push) Successful in 19s

This commit is contained in:
2024-05-12 11:07:40 +02:00
parent cc42815cce
commit 5260b6eba8
+16
View File
@@ -190,3 +190,19 @@ class Game(Serializable):
def end_game(self):
self.lobby.remove(self)
self.ended = True
def kill_team(self, team: Team):
if team == self.current_turn:
self.end_turn()
for p in self.players:
if p.team != team:
continue
self.players.remove(p)
if team in self.teams:
self.teams.remove(team)
if len(self.teams) <= 1:
self.end_game()