Browse Source

Startegická: Oprava herní logiky

master
Jiří Kalvoda 2 years ago
parent
commit
ebaa651c0d
  1. 2
      server/hra/game.py
  2. 8
      server/hra/lib.py

2
server/hra/game.py

@ -130,7 +130,7 @@ class Occupy(Logic):
for team_id, move in enumerate(moves):
if move is not None:
for member in move["members"]:
if member["id"] not in id_positions:
if member["id"] not in id_positions[team_id]:
# Neplatné ID vojáka
continue
id_moves[team_id][member["id"]] = member["action"]

8
server/hra/lib.py

@ -29,18 +29,10 @@ def game_step(game_id: int):
for i in ses.query(db.Move).filter_by(game_id=game.game_id, round=old_round_id).all():
moves[i.team_id] = i.get_move()
print(old_state)
print(moves)
print(old_round_id)
print()
ses.commit()
x, points = game.get_logic().step(old_state, moves, old_round_id)
print(x)
print(points)
new_state = db.State(game_id=game.game_id, round=new_round_id, state=db.new_big_data(x), create_time=time)
ses.add(new_state)

Loading…
Cancel
Save