From 67cd40a3f059e7a2e517faf53f1de0be9b8be110 Mon Sep 17 00:00:00 2001 From: kulisak12 Date: Sun, 18 Sep 2022 15:01:10 +0200 Subject: [PATCH] =?UTF-8?q?Strategick=C3=A1:=20Na=C4=8Dti=20protected=5Ffo?= =?UTF-8?q?r=5Fteam?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- klient/play.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/klient/play.py b/klient/play.py index 5ebbbd7..576ad3e 100755 --- a/klient/play.py +++ b/klient/play.py @@ -54,12 +54,14 @@ class Field: def __init__(self, i: int, j: int, hill: bool, home_for_team: Optional[int], - occupied_by_team: Optional[int]) -> None: + occupied_by_team: Optional[int], + protected_for_team: Optional[int],) -> None: self.i = i self.j = j self.hill = hill self.home_for_team = home_for_team self.occupied_by_team = occupied_by_team + self.protected_for_team = protected_for_team def __eq__(self, other: Field) -> bool: return (self.i, self.j) == (other.i, other.j) @@ -93,7 +95,8 @@ class Field: if self.hill: return False - if self.home_for_team is not None and self.home_for_team != team: + if (self.protected_for_team is not None and + self.protected_for_team != team): return False return True @@ -178,6 +181,7 @@ def parse_world(world: dict) -> List[List[Field]]: field["hill"], field["home_for_team"], field["occupied_by_team"], + field["protected_for_team"], ) members = [] for member in field["members"]: