change nomenclature
This commit is contained in:
@ -5,15 +5,15 @@ from wiz_game import the_game
|
||||
|
||||
@api.route("/control/")
|
||||
def index(req, resp):
|
||||
hand_finished = the_game.is_hand_finished()
|
||||
round_finished = the_game.is_round_finished()
|
||||
trick_finished = the_game.is_trick_finished()
|
||||
|
||||
if hand_finished:
|
||||
if round_finished:
|
||||
trick_winner, highest_card = the_game.get_trick_winner()
|
||||
winner = trick_winner.name
|
||||
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(),
|
||||
hand_finished=True, trick_finished=False, trick_winner=winner,
|
||||
round_finished=True, trick_finished=False, trick_winner=winner,
|
||||
highest_card=highest_card
|
||||
)
|
||||
elif trick_finished:
|
||||
@ -30,9 +30,9 @@ def index(req, resp):
|
||||
round_finished=False, trick_finished=False
|
||||
)
|
||||
|
||||
@api.route("/control/next_hand/")
|
||||
async def start_next_hand(req, resp):
|
||||
the_game.next_hand()
|
||||
@api.route("/control/next_round/")
|
||||
async def start_next_round(req, resp):
|
||||
the_game.next_round()
|
||||
await the_game.send_page_reload()
|
||||
api.redirect(resp, '/control/', status_code=303)
|
||||
|
||||
@ -46,9 +46,9 @@ async def start_next_trick(req, resp):
|
||||
|
||||
@api.route("/control/undo_last/")
|
||||
async def undo_last(req, resp):
|
||||
hand_finished = the_game.is_hand_finished()
|
||||
round_finished = the_game.is_round_finished()
|
||||
if the_game.played_cards:
|
||||
if not hand_finished:
|
||||
if not round_finished:
|
||||
p, c = the_game.played_cards.pop()
|
||||
the_game.active_player -= 1
|
||||
p.add_card(c)
|
||||
|
@ -37,7 +37,7 @@ async def play_card(player, card):
|
||||
isActive = False
|
||||
if isActive:
|
||||
the_game.play_card(player, card)
|
||||
if the_game.is_hand_finished():
|
||||
if the_game.is_round_finished():
|
||||
trick_winner, highest_card = the_game.get_trick_winner()
|
||||
trick_winner.take_trick()
|
||||
elif the_game.is_trick_finished():
|
||||
|
Reference in New Issue
Block a user