Strategická: Načtení kopců z configu
This commit is contained in:
parent
b1cf03f130
commit
811280a8b2
2 changed files with 39 additions and 4 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue