diff --git a/server/bin/create_game b/server/bin/create_game index d437f70..cfc4a29 100755 --- a/server/bin/create_game +++ b/server/bin/create_game @@ -15,6 +15,39 @@ configuration = { "teams_height": 4, "width_per_team": 30, "height_per_team": 30, + # seed=5 + "hills": [ + ".xx....x......................", + ".xxx...xx.....................", + "...x...............x......x...", + ".......xx..........xx.........", + ".......xx.....................", + ".......x......................", + "..............................", + ".............xxx......xx......", + ".............xx.......xx......", + "......................xx......", + "...xx....x............x.......", + "...xx....xx...................", + "..............................", + "......x.......................", + ".....x........................", + ".x............................", + ".x.....................x......", + ".x....................xx......", + "......................xx......", + "..xx...................x......", + ".xxx..........................", + "..............................", + "............xxx......xx.......", + "............xx.......xx.......", + ".......................x......", + ".....x........x........x......", + "..............xxx........x....", + "..............................", + ".............x................", + "............xx................" + ] } g = db.Game(game_mode=mode, configuration=configuration, teams_count=teams_count) diff --git a/server/hra/game.py b/server/hra/game.py index 9506695..784b8f5 100644 --- a/server/hra/game.py +++ b/server/hra/game.py @@ -52,18 +52,20 @@ class Occupy(Logic): # Počáteční stav def zero_state(self) -> Any: - # TODO: Zatím negeneruju "hills" map = [ [ { "home_for_team": None, "occupied_by_team": None, - "hill": False, + "hill": (self.configuration["hills"] + [j % self.configuration["height_per_team"]] + [i % self.configuration["width_per_team"]] + == "x"), "members": [] } - for _ in range(self.map_width) + for i in range(self.map_width) ] - for _ in range(self.map_height) + for j in range(self.map_height) ] team_id = 0 home_y = self.configuration["height_per_team"] // 2