예제 #1
0
def do_actions(id, coin):
    game = Game.load(id)

    data = request.json

    actions.execute(game, coin, data['action'], data.get('data', None))
    return game.to_dict()
예제 #2
0
def list_games():
    return {'games': [g.to_dict() for g in Game.find_by_status('new')]}
예제 #3
0
def show_game(id):
    return Game.load(id).to_dict()
예제 #4
0
def join_game(id):
    game = Game.load(id)
    game.join()
    return game.to_dict()
예제 #5
0
def create_games():
    game = Game.make_new()
    return game.to_dict()
예제 #6
0
def my_game():
    return Game.find_by_active_by_client().to_dict()
예제 #7
0
def draft(id):
    game = Game.load(id)
    data = request.json
    game.cards.do_draft(data['pick'])
    return game.to_dict()
예제 #8
0
def get_actions(id, coin):
    game = Game.load(id)

    return actions.get_possible(game, coin)