Startegická: Oprava herní logiky
This commit is contained in:
parent
d614becba2
commit
ebaa651c0d
2 changed files with 1 additions and 9 deletions
|
@ -130,7 +130,7 @@ class Occupy(Logic):
|
||||||
for team_id, move in enumerate(moves):
|
for team_id, move in enumerate(moves):
|
||||||
if move is not None:
|
if move is not None:
|
||||||
for member in move["members"]:
|
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
|
# Neplatné ID vojáka
|
||||||
continue
|
continue
|
||||||
id_moves[team_id][member["id"]] = member["action"]
|
id_moves[team_id][member["id"]] = member["action"]
|
||||||
|
|
|
@ -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():
|
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()
|
moves[i.team_id] = i.get_move()
|
||||||
|
|
||||||
print(old_state)
|
|
||||||
print(moves)
|
|
||||||
print(old_round_id)
|
|
||||||
print()
|
|
||||||
|
|
||||||
ses.commit()
|
ses.commit()
|
||||||
|
|
||||||
x, points = game.get_logic().step(old_state, moves, old_round_id)
|
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)
|
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)
|
ses.add(new_state)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue