implement redirections for now

This commit is contained in:
Stefan Rupp 2020-04-07 21:13:23 +02:00
parent 989b9bdbf9
commit 663457d4bc
2 changed files with 3 additions and 7 deletions

View File

@ -13,5 +13,4 @@ def index(req, resp):
@api.route("/control/deal/{cards}")
def deal(req, resp, cards):
the_game.deal_cards(int(cards))
resp.content = api.template('home/control.html', deck=the_game.card_deck,
trump_card=the_game.trump_card, trump_color=the_game.get_trump_color())
api.redirect(resp, '/control/', status_code=303)

View File

@ -19,9 +19,6 @@ def play(req, resp, player: str, card: str):
pl = the_game.players[p]
c = pl.play_card(int(card))
the_game.table.play_card(p, c)
tcard = the_game.trump_card
tcolor = the_game.get_trump_color()
table = the_game.table
resp.content = api.template('home/player.html', player=player, cards=the_game.players[p].cards,
trump_card=tcard, trump_color=tcolor, played_cards=table.played_cards)
url = '/player/'+player
api.redirect(resp, url, status_code=303)