Browse Source

Strategická: Zobrazení akce

master
Jiří Kalvoda 2 years ago
parent
commit
5e6e4a7afa
  1. 20
      server/hra/web/game.py

20
server/hra/web/game.py

@ -19,7 +19,7 @@ import hra.db as db
from hra.web import app from hra.web import app
import hra.web.jinja_mac as jinja_mac import hra.web.jinja_mac as jinja_mac
from hra.util import hash_passwd from hra.util import hash_passwd
from hra.web.pages import BasePage, web_game_view from hra.web.pages import BasePage, web_game_view, right_for_team
wlogic_by_mode = {} wlogic_by_mode = {}
@ -80,6 +80,18 @@ class Occupy(WLogic):
q = db.get_session().query(db.Log).order_by(db.Log.log_id.desc()) q = db.get_session().query(db.Log).order_by(db.Log.log_id.desc())
conff.validate() conff.validate()
moves = []
for t in teams:
t_moves = {}
if right_for_team(t):
move = t.get_move(state.round).get_move()
if move:
for member in move["members"]:
t_moves[member["id"]] = member["action"]
moves.append(t_moves)
max_num = 999 if conff.big_fields.data else 99 max_num = 999 if conff.big_fields.data else 99
def reaming_time(id="time"): def reaming_time(id="time"):
@ -179,7 +191,11 @@ class Occupy(WLogic):
b.p().b(f"Počet osob: {len(members)}") b.p().b(f"Počet osob: {len(members)}")
with b.ul(): with b.ul():
for m in members: for m in members:
b.li(_class=f"game_team_{m['team']}")(f"Voják {m['id']} týmu {teams[m['team']].print()}") with b.li(_class=f"game_team_{m['team']}"):
b(f"Voják {m['id']} týmu {teams[m['team']].print()}")
if m['id'] in moves[m['team']]:
action = moves[m['team']][m['id']]
b(f"({action.upper()})")
b = BasePage() b = BasePage()
if not conff.show_data_only.data: if not conff.show_data_only.data:

Loading…
Cancel
Save