graph-games-proto 0.3.1802__py3-none-any.whl → 0.3.1827__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 +5 -1
- {graph_games_proto-0.3.1802.dist-info → graph_games_proto-0.3.1827.dist-info}/METADATA +1 -1
- {graph_games_proto-0.3.1802.dist-info → graph_games_proto-0.3.1827.dist-info}/RECORD +5 -5
- {graph_games_proto-0.3.1802.dist-info → graph_games_proto-0.3.1827.dist-info}/WHEEL +0 -0
- {graph_games_proto-0.3.1802.dist-info → graph_games_proto-0.3.1827.dist-info}/top_level.txt +0 -0
graph_games_proto/fns.py
CHANGED
@@ -1705,6 +1705,8 @@ class LegalAction(PClass):
|
|
1705
1705
|
faceup_draw=self.faceup_draw.get_public(state) if self.faceup_draw else None,
|
1706
1706
|
move_pieces_to_path=self.move_pieces_to_path.get_public(state) if self.move_pieces_to_path else None,
|
1707
1707
|
)
|
1708
|
+
def __eq__(self, other):
|
1709
|
+
return self.__todict__() == other.__todict__()
|
1708
1710
|
def __todict__(self):
|
1709
1711
|
return {
|
1710
1712
|
"player_idx": self.player_idx,
|
@@ -1738,7 +1740,7 @@ class LegalAction(PClass):
|
|
1738
1740
|
draw_discard=LegalActionDrawDiscard.__fromdict__(d["draw_discard"]) if d.get("draw_discard") else None,
|
1739
1741
|
faceup_draw=LegalActionFaceupDraw.__fromdict__(d["faceup_draw"]) if d.get("faceup_draw") else None,
|
1740
1742
|
move_pieces_to_path=LegalActionMovePiecesToPath.__fromdict__(d["move_pieces_to_path"]) if d.get("move_pieces_to_path") else None,
|
1741
|
-
auto_preferred=d.get("auto_preferred"
|
1743
|
+
auto_preferred=d.get("auto_preferred"), # Handle None case
|
1742
1744
|
)
|
1743
1745
|
|
1744
1746
|
|
@@ -4403,6 +4405,8 @@ def isactionlegal2(s, a):
|
|
4403
4405
|
|
4404
4406
|
|
4405
4407
|
def getnextstate2(s, a, log=False):
|
4408
|
+
if not isactionlegal2(s, a):
|
4409
|
+
raise ValueError(f"Action is not legal: {a}")
|
4406
4410
|
s = run_state_action_hooks(s, a, AFTER_ACCEPT_ACTION_HOOKS, log)
|
4407
4411
|
s = run_state_action_hooks(s, a, HANDLE_ACTION_HOOKS, log)
|
4408
4412
|
s = run_state_hooks(s, HANDLE_SCORING_HOOKS, log)
|
@@ -1,9 +1,9 @@
|
|
1
1
|
graph_games_proto/__init__.py,sha256=O5XjRfe3DlxbJn4zezDvvy7cXvL4IzIRPZCL3Y-n7s8,776
|
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=pUpAuFvrIvzHKWnfUKO3M1xIS7PvwhWrX5m9pPDd5eE,242147
|
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.1827.dist-info/METADATA,sha256=QUtI_ESEzH8_yOQOcWnQj4P0BdzdEufHuenbQXeBueI,188
|
7
|
+
graph_games_proto-0.3.1827.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
8
|
+
graph_games_proto-0.3.1827.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
|
9
|
+
graph_games_proto-0.3.1827.dist-info/RECORD,,
|
File without changes
|
File without changes
|