graph-games-proto 0.3.1765__py3-none-any.whl → 0.3.1767__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 +6 -1
- {graph_games_proto-0.3.1765.dist-info → graph_games_proto-0.3.1767.dist-info}/METADATA +1 -1
- {graph_games_proto-0.3.1765.dist-info → graph_games_proto-0.3.1767.dist-info}/RECORD +5 -5
- {graph_games_proto-0.3.1765.dist-info → graph_games_proto-0.3.1767.dist-info}/WHEEL +0 -0
- {graph_games_proto-0.3.1765.dist-info → graph_games_proto-0.3.1767.dist-info}/top_level.txt +0 -0
graph_games_proto/fns.py
CHANGED
@@ -1678,6 +1678,7 @@ class LegalAction(PClass):
|
|
1678
1678
|
draw_discard = field(type=(LegalActionDrawDiscard, type(None)), initial=None) # LegalActionDrawDiscard
|
1679
1679
|
faceup_draw = field(type=(LegalActionFaceupDraw, type(None)), initial=None) # LegalActionFaceupDraw
|
1680
1680
|
move_pieces_to_path = field(type=(LegalActionMovePiecesToPath, type(None)), initial=None) # LegalActionMovePiecesToPath
|
1681
|
+
auto_preferred = field(type=bool, initial=False) # bool
|
1681
1682
|
def get_default_action(self, state):
|
1682
1683
|
submitted_at = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
1683
1684
|
if self.discard:
|
@@ -1719,6 +1720,7 @@ class LegalAction(PClass):
|
|
1719
1720
|
"draw_discard": self.draw_discard.__todict__() if self.draw_discard else None,
|
1720
1721
|
"faceup_draw": self.faceup_draw.__todict__() if self.faceup_draw else None,
|
1721
1722
|
"move_pieces_to_path": self.move_pieces_to_path.__todict__() if self.move_pieces_to_path else None,
|
1723
|
+
"auto_preferred": self.auto_preferred,
|
1722
1724
|
}
|
1723
1725
|
@staticmethod
|
1724
1726
|
def __fromdict__(d):
|
@@ -1736,6 +1738,7 @@ class LegalAction(PClass):
|
|
1736
1738
|
draw_discard=LegalActionDrawDiscard.__fromdict__(d["draw_discard"]) if d.get("draw_discard") else None,
|
1737
1739
|
faceup_draw=LegalActionFaceupDraw.__fromdict__(d["faceup_draw"]) if d.get("faceup_draw") else None,
|
1738
1740
|
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", False), # Handle None case
|
1739
1742
|
)
|
1740
1743
|
|
1741
1744
|
|
@@ -3258,7 +3261,8 @@ def handle_draw_action(game, action):
|
|
3258
3261
|
)
|
3259
3262
|
|
3260
3263
|
# TODO: extract this out to user-defined function/hook
|
3261
|
-
|
3264
|
+
if draw.quantity == 1:
|
3265
|
+
game = append_follow_up_draw_legal_actions(game, action)
|
3262
3266
|
|
3263
3267
|
return game
|
3264
3268
|
|
@@ -6639,6 +6643,7 @@ DEFAULT_LEGAL_ACTIONS_HOOK = """def handler(game, player_idx):
|
|
6639
6643
|
game = append_to_legal_actions(
|
6640
6644
|
game,
|
6641
6645
|
LegalAction(
|
6646
|
+
auto_preferred=True,
|
6642
6647
|
player_idx=player_idx,
|
6643
6648
|
name="DRAW",
|
6644
6649
|
instruction="draw a unit",
|
@@ -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=A6l7DrNoU4slkgBgagmyo96wLRUuOek_V0daIDa-XyE,240285
|
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.1767.dist-info/METADATA,sha256=sUMhdJ46n4kloyjiTrXJpIOE4268b471P3-q7tE35Lw,188
|
7
|
+
graph_games_proto-0.3.1767.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
8
|
+
graph_games_proto-0.3.1767.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
|
9
|
+
graph_games_proto-0.3.1767.dist-info/RECORD,,
|
File without changes
|
File without changes
|