From 4c2b4f310e2ea630ba781484d6251842c76f526b Mon Sep 17 00:00:00 2001 From: Jonas Zeunert Date: Mon, 6 Jun 2022 18:46:58 +0200 Subject: [PATCH] Activate Playerlamps on start --- GameState.py | 5 +++++ lamps/LampGroup.py | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/GameState.py b/GameState.py index 27306df..b49ef56 100644 --- a/GameState.py +++ b/GameState.py @@ -1,10 +1,12 @@ import logging +from lamps.LampGroup import PLAYER_LAMPS class GameState: def __init__(self, players, highscore, currentPlayerID = 0): self.players = players self.gameStateID = currentPlayerID self.highscore = highscore + PLAYER_LAMPS.activateNext() @property def currentPlayer(self): @@ -22,4 +24,7 @@ class GameState: self.players.remove(savedPlayer) self.players.append(savedPlayer) + PLAYER_LAMPS.deactivateCurrent() + PLAYER_LAMPS.activateNext() + self.gameState.currentPlayer.activate() diff --git a/lamps/LampGroup.py b/lamps/LampGroup.py index b6244bd..69842cb 100644 --- a/lamps/LampGroup.py +++ b/lamps/LampGroup.py @@ -33,6 +33,13 @@ class LampGroup: self.currentLamp -= 1 +PLAYER_LAMPS = LampGroup([ + Lamp("Can Play 1"), + Lamp("Can Play 2"), + Lamp("Can Play 3"), + Lamp("Can Play 4") +]) + CHAMP_LAMPS = LampGroup([ Lamp("C Of Champ"), Lamp("H Of Champ"),