-
Notifications
You must be signed in to change notification settings - Fork 2
/
ExampleGame.py
99 lines (70 loc) · 2.21 KB
/
ExampleGame.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
'''Notes:
- if constraints functions, should be able to call all right before needed rather than make list of functions
- could also encapsulate constraints in a "phase constraints" function
- maybe a method for each phase would make most conceptual sense
'''
import DeckBuilding
import Features
class ExampleGame(DeckBuilding.DeckBuilding):
'''
An example game extending the DeckBuilding abstract class. For testing purposes and for serving as an example
of what other games should look like.
This game is a simplified version of Thunderbolt Apache Leader with the Iraq campaign wth Surge situation.
'''
def __init__(self, params):
'''
Constructor
'''
super(ExampleGame, self).__init__()
self.situation = None
self.campaign = None
self.board = ExampleGameBoard()
def setup_friendly_units(self, policy):
pass
def setup_enemy_units(self):
pass
def roll_to_location(self, roll):
pass
def setup_environment(self):
pass
def setup_random_events(self):
pass
def turn_setup_done(self):
pass
def play(self, policy):
stage_order = []
constraints = []
self.play(policy, stage_order, constraints)
def game_loop_done(self):
pass
def turn_setup(self, policy):
pass
def is_win_state(self):
pass
def is_lose_state(self):
pass
def transition_prob(self, action, next_state):
pass
def legal_actions(self):
pass
def reward(self, action):
pass
def next_states(self, action):
pass
###############
# Constraints #
###############
class ExampleGameBoard(DeckBuilding.Board):
def __init__(self):
pass
def can_put_piece(self, piece, location, constraints):
pass
def place_piece(self, piece, location, constraints):
pass
def main():
features = Features.Features(ExampleGame)
policy = None
features.generateGames(policy, 100)
features.generateFeatures("example_features.txt")
if __name__ == "__main__":
main()