graph-games-proto 0.3.2045__py3-none-any.whl → 0.3.2047__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 CHANGED
@@ -2802,7 +2802,7 @@ def score_public_items(state, player_idx):
2802
2802
  def score_private_items(state, player_idx):
2803
2803
  items = []
2804
2804
  goaluuid2goal = {goal.uuid: goal for goal in state.kernel.goals}
2805
- goal_completions = get_goal_completions(state, player_idx)
2805
+ goal_completions = get_goal_completions(state.kernel, player_idx)
2806
2806
  complete_goal_uuids = [gc.goal_uuid for gc in goal_completions if gc.complete]
2807
2807
  incomplete_goal_uuids = [gc.goal_uuid for gc in goal_completions if not gc.complete]
2808
2808
  for complete_goal_uuid in complete_goal_uuids:
@@ -3167,15 +3167,15 @@ def handle_draw_discard_action(kernel, action):
3167
3167
  )
3168
3168
 
3169
3169
 
3170
- @dispatch(State, Action2)
3171
- def get_follow_up_draw_legal_actions(state, action):
3170
+ @dispatch(StateKernel, Action2)
3171
+ def get_follow_up_draw_legal_actions(kernel, action):
3172
3172
  to_return = []
3173
3173
  legal_action = action.legal_action
3174
- if len(state.kernel.history) >= 2:
3175
- last_action = state.kernel.history[-2]
3174
+ if len(kernel.history) >= 2:
3175
+ last_action = kernel.history[-2]
3176
3176
  if (last_action.legal_action.player_idx != legal_action.player_idx) or last_action.legal_action.name == "INITIAL-GOAL-KEEP":
3177
3177
 
3178
- if len(state.kernel.decks[0].facedown_stack) >= 1:
3178
+ if len(kernel.decks[0].facedown_stack) >= 1:
3179
3179
  to_return.append(
3180
3180
  LegalAction(
3181
3181
  auto_preferred=True,
@@ -3183,7 +3183,7 @@ def get_follow_up_draw_legal_actions(state, action):
3183
3183
  name="DRAW",
3184
3184
  instruction="draw a unit",
3185
3185
  allotted_seconds=DEFAULT_ALLOTTED_SECONDS,
3186
- allotted_since_action_idx=(len(state.kernel.history) - 1),
3186
+ allotted_since_action_idx=(len(kernel.history) - 1),
3187
3187
  draw=LegalActionDraw(
3188
3188
  deck_idx=0,
3189
3189
  quantity=1,
@@ -3191,16 +3191,16 @@ def get_follow_up_draw_legal_actions(state, action):
3191
3191
  )
3192
3192
  )
3193
3193
 
3194
- for card_uuid in state.kernel.decks[0].faceup_spots:
3194
+ for card_uuid in kernel.kernel.decks[0].faceup_spots:
3195
3195
  if card_uuid:
3196
- if not state.kernel.carduuid2card[card_uuid].is_wild:
3196
+ if not kernel.kernel.carduuid2card[card_uuid].is_wild:
3197
3197
  to_return.append(
3198
3198
  LegalAction(
3199
3199
  player_idx=legal_action.player_idx,
3200
3200
  name="FACEUP-DRAW",
3201
3201
  instruction="draw a faceup unit",
3202
3202
  allotted_seconds=DEFAULT_ALLOTTED_SECONDS,
3203
- allotted_since_action_idx=(len(state.kernel.history) - 1),
3203
+ allotted_since_action_idx=(len(kernel.kernel.history) - 1),
3204
3204
  faceup_draw=LegalActionFaceupDraw(
3205
3205
  deck_idx=0,
3206
3206
  card_uuid=card_uuid,
@@ -4727,6 +4727,7 @@ def getfirstplayeridx(rng, num_players):
4727
4727
  return rng.randint(0, num_players-1)
4728
4728
 
4729
4729
 
4730
+ @dispatch(State, int)
4730
4731
  def get_legal_actions3(s, player_idx):
4731
4732
  return [a for a in s.legal_actions_3 if a.player_idx == player_idx]
4732
4733
 
@@ -4736,17 +4737,17 @@ def get_legal_actions(s, player_idx):
4736
4737
  return [a for a in s.legal_actions_3 if a.player_idx == player_idx]
4737
4738
 
4738
4739
 
4739
- @dispatch(State, int)
4740
- def get_goal_completions(s, player_idx):
4740
+ @dispatch(StateKernel, int)
4741
+ def get_goal_completions(kernel, player_idx):
4741
4742
  # print("len(get_goals(s, player_idx)): ", len(get_goals(s, player_idx)))
4742
4743
  # print("len(s.history): ", len(s.history))
4743
4744
  # print("player.cards: ", len(s.players[player_idx].cards))
4744
4745
  return [
4745
4746
  GoalCompletion(
4746
4747
  goal_uuid=goal.uuid,
4747
- complete=is_goal_complete(s, goal, player_idx),
4748
+ complete=is_goal_complete(kernel, goal, player_idx),
4748
4749
  )
4749
- for goal in get_goals(s.kernel, player_idx)
4750
+ for goal in get_goals(kernel, player_idx)
4750
4751
  ]
4751
4752
 
4752
4753
 
@@ -5242,7 +5243,7 @@ def getprivatestate(s, player_idx):
5242
5243
  player_score=getprivateplayerscore(s, s.player_scores_3[player_idx]),
5243
5244
  player=s.kernel.players[player_idx],
5244
5245
  legal_actions_3 = get_legal_actions3(s, player_idx),
5245
- goal_completions=get_goal_completions(s, player_idx),
5246
+ goal_completions=get_goal_completions(s.kernel, player_idx),
5246
5247
  )
5247
5248
 
5248
5249
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graph_games_proto
3
- Version: 0.3.2045
3
+ Version: 0.3.2047
4
4
  Requires-Dist: multipledispatch==1.0.0
5
5
  Requires-Dist: pyrsistent==0.20.0
6
6
  Requires-Dist: numpy==2.2.4
@@ -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=5FkQQV9pzpX8d5ss1XL1rR29ef6rTZgcM0U94aKcAI4,193861
3
+ graph_games_proto/fns.py,sha256=5q7DkWUoZgSPZo7x_09oIKz4B6DN6__khBDzCt4H-UM,193897
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.2045.dist-info/METADATA,sha256=52qZ63D-sHB6TVNoa7FgJ_2_svgDpuPWsJLG8mnJuZg,188
7
- graph_games_proto-0.3.2045.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
- graph_games_proto-0.3.2045.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
9
- graph_games_proto-0.3.2045.dist-info/RECORD,,
6
+ graph_games_proto-0.3.2047.dist-info/METADATA,sha256=cxoC5FsNQ3F3kcpnv8XK6-7PdbEnQklE_eFR495tnRg,188
7
+ graph_games_proto-0.3.2047.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
+ graph_games_proto-0.3.2047.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
9
+ graph_games_proto-0.3.2047.dist-info/RECORD,,