graph-games-proto 0.3.1696__py3-none-any.whl → 0.3.1698__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 +10 -6
- {graph_games_proto-0.3.1696.dist-info → graph_games_proto-0.3.1698.dist-info}/METADATA +1 -1
- {graph_games_proto-0.3.1696.dist-info → graph_games_proto-0.3.1698.dist-info}/RECORD +5 -5
- {graph_games_proto-0.3.1696.dist-info → graph_games_proto-0.3.1698.dist-info}/WHEEL +0 -0
- {graph_games_proto-0.3.1696.dist-info → graph_games_proto-0.3.1698.dist-info}/top_level.txt +0 -0
graph_games_proto/fns.py
CHANGED
@@ -15,6 +15,9 @@ from functools import cmp_to_key
|
|
15
15
|
from itertools import combinations as itertools_combinations, chain
|
16
16
|
from collections import deque
|
17
17
|
|
18
|
+
DEFAULT_ALLOTTED_SECONDS = 20
|
19
|
+
INITIAL_ALLOTTED_SECONDS = 30
|
20
|
+
|
18
21
|
class NoAction(PClass):
|
19
22
|
pass
|
20
23
|
|
@@ -1727,7 +1730,7 @@ class LegalAction(PClass):
|
|
1727
1730
|
name=d["name"],
|
1728
1731
|
title=d.get("title"), # Handle None case
|
1729
1732
|
instruction=d.get("instruction"), # Handle None case
|
1730
|
-
allotted_seconds=d.get("allotted_seconds",
|
1733
|
+
allotted_seconds=d.get("allotted_seconds", DEFAULT_ALLOTTED_SECONDS), # Handle None case
|
1731
1734
|
allotted_since_action_idx=d.get("allotted_since_action_idx", -1), # Handle None case
|
1732
1735
|
btn_text=d.get("btn_text"), # Handle None case
|
1733
1736
|
discard=LegalActionDiscard.__fromdict__(d["discard"]) if d.get("discard") else None,
|
@@ -3223,7 +3226,7 @@ def append_follow_up_draw_legal_actions(game, action):
|
|
3223
3226
|
player_idx=legal_action.player_idx,
|
3224
3227
|
name="DRAW",
|
3225
3228
|
instruction="draw a unit",
|
3226
|
-
allotted_seconds=
|
3229
|
+
allotted_seconds=DEFAULT_ALLOTTED_SECONDS,
|
3227
3230
|
allotted_since_action_idx=(len(game.history) - 1),
|
3228
3231
|
draw=LegalActionDraw(
|
3229
3232
|
deck_idx=0,
|
@@ -3239,7 +3242,7 @@ def append_follow_up_draw_legal_actions(game, action):
|
|
3239
3242
|
player_idx=legal_action.player_idx,
|
3240
3243
|
name="FACEUP-DRAW",
|
3241
3244
|
instruction="draw a faceup unit",
|
3242
|
-
allotted_seconds=
|
3245
|
+
allotted_seconds=DEFAULT_ALLOTTED_SECONDS,
|
3243
3246
|
allotted_since_action_idx=(len(game.history) - 1),
|
3244
3247
|
faceup_draw=LegalActionFaceupDraw(
|
3245
3248
|
deck_idx=0,
|
@@ -3883,7 +3886,7 @@ def get_legal_actions_for_path(game, player_idx, path_idx):
|
|
3883
3886
|
name="CLAIM-PATH",
|
3884
3887
|
title="Select resources to claim path",
|
3885
3888
|
instruction="claim a path",
|
3886
|
-
allotted_seconds=
|
3889
|
+
allotted_seconds=DEFAULT_ALLOTTED_SECONDS,
|
3887
3890
|
allotted_since_action_idx=(len(game.history) - 1),
|
3888
3891
|
btn_text="Claim path",
|
3889
3892
|
move_pieces_to_path=LegalActionMovePiecesToPath(
|
@@ -3930,6 +3933,7 @@ def is_path_open_to_player(game, path_idx, player_idx):
|
|
3930
3933
|
|
3931
3934
|
|
3932
3935
|
HOOK_NAMESPACE = {
|
3936
|
+
'DEFAULT_ALLOTTED_SECONDS': DEFAULT_ALLOTTED_SECONDS,
|
3933
3937
|
'shuffle_all_decks': shuffle_all_decks,
|
3934
3938
|
'shuffle_player_order': shuffle_player_order,
|
3935
3939
|
'deal_cards_to_each_player': deal_cards_to_each_player,
|
@@ -7131,7 +7135,7 @@ INIT_HOOK_6 = """def handler(game):
|
|
7131
7135
|
player_idx=player.idx,
|
7132
7136
|
name="INITIAL-GOAL-KEEP",
|
7133
7137
|
instruction="Your move. Please select the routes you want to keep.",
|
7134
|
-
allotted_seconds=
|
7138
|
+
allotted_seconds=INITIAL_ALLOTTED_SECONDS,
|
7135
7139
|
allotted_since_action_idx=(len(game.history) - 1),
|
7136
7140
|
keep=LegalActionKeep(
|
7137
7141
|
deck_idx=1,
|
@@ -7146,7 +7150,7 @@ INIT_HOOK_7 = """def handler(game):
|
|
7146
7150
|
"""
|
7147
7151
|
|
7148
7152
|
DEFAULT_LEGAL_ACTIONS_HOOK = """def handler(game, player_idx):
|
7149
|
-
allotted_seconds =
|
7153
|
+
allotted_seconds = DEFAULT_ALLOTTED_SECONDS
|
7150
7154
|
allotted_since_action_idx = len(game.history) - 1
|
7151
7155
|
|
7152
7156
|
game = append_to_legal_actions(
|
@@ -1,9 +1,9 @@
|
|
1
1
|
graph_games_proto/__init__.py,sha256=LOpk1mGZxPWMRGrPNoXDENn7JPG6rNfhieehItW8bEA,881
|
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=FZL72tP0maXEf0Y5yrrOo3j2h1da6MF9Ggo-B1UeoJc,263439
|
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.1698.dist-info/METADATA,sha256=3WqppKhf1uAG3DmykS5iw3LhIWoFgNhPgN0S5OKPFTA,188
|
7
|
+
graph_games_proto-0.3.1698.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
8
|
+
graph_games_proto-0.3.1698.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
|
9
|
+
graph_games_proto-0.3.1698.dist-info/RECORD,,
|
File without changes
|
File without changes
|