-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtower.py
58 lines (37 loc) · 1.41 KB
/
tower.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from __future__ import annotations
from random_gen import RandomGen
from team import MonsterTeam
from battle import Battle
from elements import Element
from data_structures.referential_array import ArrayR
class BattleTower:
MIN_LIVES = 2
MAX_LIVES = 10
def __init__(self, battle: Battle|None=None) -> None:
self.battle = battle or Battle(verbosity=0)
def set_my_team(self, team: MonsterTeam) -> None:
# Generate the team lives here too.
raise NotImplementedError
def generate_teams(self, n: int) -> None:
raise NotImplementedError
def battles_remaining(self) -> bool:
raise NotImplementedError
def next_battle(self) -> tuple[Battle.Result, MonsterTeam, MonsterTeam, int, int]:
raise NotImplementedError
def out_of_meta(self) -> ArrayR[Element]:
raise NotImplementedError
def sort_by_lives(self):
# 1054 ONLY
raise NotImplementedError
def tournament_balanced(tournament_array: ArrayR[str]):
# 1054 ONLY
raise NotImplementedError
def main():
RandomGen.set_seed(129371)
bt = BattleTower(Battle(verbosity=3))
bt.set_my_team(MonsterTeam(MonsterTeam.TeamMode.BACK, MonsterTeam.SelectionMode.RANDOM))
bt.generate_teams(3)
for result, my_team, tower_team, player_lives, tower_lives in bt:
print(result, my_team, tower_team, player_lives, tower_lives)
if __name__ == "__main__":
main()