graph-games-proto 0.3.1887__py3-none-any.whl → 0.3.1888__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- graph_games_proto/fns.py +13 -0
- {graph_games_proto-0.3.1887.dist-info → graph_games_proto-0.3.1888.dist-info}/METADATA +1 -1
- {graph_games_proto-0.3.1887.dist-info → graph_games_proto-0.3.1888.dist-info}/RECORD +5 -5
- {graph_games_proto-0.3.1887.dist-info → graph_games_proto-0.3.1888.dist-info}/WHEEL +0 -0
- {graph_games_proto-0.3.1887.dist-info → graph_games_proto-0.3.1888.dist-info}/top_level.txt +0 -0
graph_games_proto/fns.py
CHANGED
@@ -1104,6 +1104,7 @@ class PrivateState(PClass):
|
|
1104
1104
|
player_score = field(type=PrivatePlayerScore)
|
1105
1105
|
player = field(type=Player)
|
1106
1106
|
legal_actions_2 = field(type=list) # List[LegalAction]
|
1107
|
+
legal_actions_3 = field(type=list) # List[LegalAction]
|
1107
1108
|
goal_completions = field(type=list, initial=[]) # List[GoalCompletion]
|
1108
1109
|
def __todict__(self):
|
1109
1110
|
return {
|
@@ -1111,6 +1112,7 @@ class PrivateState(PClass):
|
|
1111
1112
|
"player_score": self.player_score.__todict__(),
|
1112
1113
|
"player": self.player.__todict__(),
|
1113
1114
|
"legal_actions_2": [x.__todict__() for x in self.legal_actions_2],
|
1115
|
+
"legal_actions_3": [x.__todict__() for x in self.legal_actions_3],
|
1114
1116
|
"goal_completions": [x.__todict__() for x in self.goal_completions],
|
1115
1117
|
}
|
1116
1118
|
@staticmethod
|
@@ -1120,6 +1122,7 @@ class PrivateState(PClass):
|
|
1120
1122
|
player_score=PrivatePlayerScore.__fromdict__(d["player_score"]),
|
1121
1123
|
player=Player.__fromdict__(d["player"]),
|
1122
1124
|
legal_actions_2=[LegalAction.__fromdict__(x) for x in d["legal_actions_2"]],
|
1125
|
+
legal_actions_3=[LegalAction.__fromdict__(x) for x in d["legal_actions_3"]],
|
1123
1126
|
goal_completions=[GoalCompletion.__fromdict__(x) for x in d["goal_completions"]],
|
1124
1127
|
)
|
1125
1128
|
|
@@ -1954,6 +1957,7 @@ class State(PClass):
|
|
1954
1957
|
edgetuple2uuid = field(type=dict) # Dict[Tuple[int, int], str]
|
1955
1958
|
regions = field(type=list) # List[Region]
|
1956
1959
|
legal_actions_2 = field(type=list) # List[LegalAction]
|
1960
|
+
legal_actions_3 = field(type=list) # List[LegalAction]
|
1957
1961
|
piles = field(type=list) # List[Pile]
|
1958
1962
|
players = field(type=list) # List[Player]
|
1959
1963
|
player_idxs = field(type=list) # List[int]
|
@@ -1985,6 +1989,7 @@ class State(PClass):
|
|
1985
1989
|
"edgetuple2uuid": [{"k": list(k), "v": v} for k, v in self.edgetuple2uuid.items()],
|
1986
1990
|
"regions": [region.__todict__() for region in self.regions],
|
1987
1991
|
"legal_actions_2": [x.__todict__() for x in self.legal_actions_2],
|
1992
|
+
"legal_actions_3": [x.__todict__() for x in self.legal_actions_3],
|
1988
1993
|
"piles": [pile.__todict__() for pile in self.piles],
|
1989
1994
|
"players": [player.__todict__() for player in self.players],
|
1990
1995
|
"player_idxs": self.player_idxs,
|
@@ -2018,6 +2023,7 @@ class State(PClass):
|
|
2018
2023
|
edgetuple2uuid={tuple(item["k"]): item["v"] for item in d["edgetuple2uuid"]},
|
2019
2024
|
regions=[Region.__fromdict__(r) for r in d["regions"]],
|
2020
2025
|
legal_actions_2=[LegalAction.__fromdict__(x) for x in d["legal_actions_2"]],
|
2026
|
+
legal_actions_3=[LegalAction.__fromdict__(x) for x in d["legal_actions_3"]],
|
2021
2027
|
piles=[Pile.__fromdict__(p) for p in d["piles"]],
|
2022
2028
|
players=[Player.__fromdict__(p) for p in d["players"]],
|
2023
2029
|
player_idxs=d["player_idxs"],
|
@@ -2478,6 +2484,11 @@ def getsettingvalue(s, setting_name):
|
|
2478
2484
|
return getsettingvalue(s.game_config.fig, setting_name)
|
2479
2485
|
|
2480
2486
|
|
2487
|
+
def calclegalactions3(state):
|
2488
|
+
legal_actions = []
|
2489
|
+
return legal_actions
|
2490
|
+
|
2491
|
+
|
2481
2492
|
@dispatch(GameConfig)
|
2482
2493
|
def getinitialstate(game_config):
|
2483
2494
|
fig = game_config.fig
|
@@ -2594,6 +2605,7 @@ def getinitialstate(game_config):
|
|
2594
2605
|
edgetuple2uuid = edgetuple2uuid,
|
2595
2606
|
regions = get_regions(board_config),
|
2596
2607
|
legal_actions_2=[],
|
2608
|
+
legal_actions_3=[],
|
2597
2609
|
piles=piles,
|
2598
2610
|
players=[Player(idx=idx, pieces=[], cards=[], discard_tray=[]) for idx in range(game_config.num_players)],
|
2599
2611
|
player_idxs=list(range(game_config.num_players)),
|
@@ -2605,6 +2617,7 @@ def getinitialstate(game_config):
|
|
2605
2617
|
)
|
2606
2618
|
|
2607
2619
|
state = run_state_hooks(state, INITIALIZATION_HOOKS, True)
|
2620
|
+
state = state.set(legal_actions_3=calclegalactions3(state))
|
2608
2621
|
return state
|
2609
2622
|
|
2610
2623
|
|
@@ -1,9 +1,9 @@
|
|
1
1
|
graph_games_proto/__init__.py,sha256=_EVQR-51XehfH45XZlba1WPdx3omS3Gm1nTwrgGyn2Q,667
|
2
2
|
graph_games_proto/all_types.py,sha256=IpbwftEcHS5Ewz-saFNk0lO9FvcbuHG36odRTayCXUk,54911
|
3
|
-
graph_games_proto/fns.py,sha256=
|
3
|
+
graph_games_proto/fns.py,sha256=w4Hkn6z0bUuZeInMvSbbNpFjzAlp1UgZsamFBsuN2to,181960
|
4
4
|
graph_games_proto/main.py,sha256=fj2U7KcwrpZtuUhjOX5yVxY18LZvvsxDFYZ_S5mxe04,145
|
5
5
|
graph_games_proto/state.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
-
graph_games_proto-0.3.
|
7
|
-
graph_games_proto-0.3.
|
8
|
-
graph_games_proto-0.3.
|
9
|
-
graph_games_proto-0.3.
|
6
|
+
graph_games_proto-0.3.1888.dist-info/METADATA,sha256=NL9gcA4L8dn0uIdH-6uDG3gsDX6p_e2sx_sUyeCFm0w,188
|
7
|
+
graph_games_proto-0.3.1888.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
8
|
+
graph_games_proto-0.3.1888.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
|
9
|
+
graph_games_proto-0.3.1888.dist-info/RECORD,,
|
File without changes
|
File without changes
|