mirror of
https://github.com/Smaug123/hanabi-server
synced 2025-10-06 09:08:41 +00:00
Log cards at start of game
This commit is contained in:
@@ -13,7 +13,7 @@ class HanabiColour(enum.Enum):
|
||||
|
||||
class HanabiCard(dict):
|
||||
def __str__(self):
|
||||
return "{} {}".format(self.rank, self.colour)
|
||||
return "{} {}".format(self['rank'], self['colour'])
|
||||
|
||||
def __repr__(self):
|
||||
return "HanabiCard({}, {})".format(self.get('colour'), self.get('rank'))
|
||||
|
@@ -286,8 +286,19 @@ class Game(Resource):
|
||||
|
||||
new_id = _get_new_game_index()
|
||||
data_path = _game_data_path(new_id)
|
||||
data = cache.GameDataStore(data_path)
|
||||
data.create(args['player'])
|
||||
data_store = cache.GameDataStore(data_path)
|
||||
data_store.create(args['player'])
|
||||
data = data_store.get()
|
||||
|
||||
log('New game with players {}'.format(data[cache.players_key]), new_id)
|
||||
log('Deck:', new_id)
|
||||
for c in data[cache.deck_key]:
|
||||
log(' {}'.format(str(c)), new_id)
|
||||
log('Hands:', new_id)
|
||||
for p in data[cache.players_key]:
|
||||
log(' {}'.format(p), new_id)
|
||||
for c in data[cache.hands_key][p]:
|
||||
log(' {}'.format(str(c)), new_id)
|
||||
|
||||
return {'id': new_id}
|
||||
|
||||
|
Reference in New Issue
Block a user