playerstate to prop

This commit is contained in:
Jonas Zeunert
2022-05-07 14:07:55 +02:00
parent 83cb1c26b4
commit e03d0e7aa5
20 changed files with 43 additions and 40 deletions

View File

@@ -6,10 +6,12 @@ class GameState:
self.currentPlayerID = currentPlayerID
self.highscore = highscore
@property
def currentPlayer(self):
return self.players[self.currentPlayerID]
def setCurrentPlayer(self, playerId):
@currentPlayer.setter
def currentPlayer(self, playerId):
if(playerId > len(self.players)):
pass # todo throw error