graph-games-proto 0.3.2276__py3-none-any.whl → 0.3.2292__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
@@ -3334,7 +3334,9 @@ def handle_draw_discard_action(kernel, action):
3334
3334
  return kernel
3335
3335
  legal_action = action.legal_action
3336
3336
  draw_discard = legal_action.draw_discard
3337
- player = kernel.players[legal_action.player_idx]
3337
+
3338
+ p_idx = legal_action.player_idx
3339
+ player = kernel.players[p_idx]
3338
3340
  deck = kernel.decks[draw_discard.deck_idx]
3339
3341
 
3340
3342
  if len(deck.facedown_stack.cards) == 0:
@@ -3342,8 +3344,9 @@ def handle_draw_discard_action(kernel, action):
3342
3344
 
3343
3345
  for _ in range(draw_discard.quantity):
3344
3346
  drawn_card = deck.facedown_stack.cards.pop()
3345
- player.discard_tray.append(drawn_card)
3346
-
3347
+ player = player.set(discard_tray=player.discard_tray.append(drawn_card))
3348
+
3349
+ kernel.players[p_idx] = player # TODO: make it this: players=kernel.players.set(p_idx, player)
3347
3350
  return kernel.set(
3348
3351
  players=kernel.players,
3349
3352
  decks=kernel.decks,
@@ -3981,14 +3984,16 @@ def deal_cards_to_each_player_discard_tray(kernel, deck_idx, num_cards):
3981
3984
  if not deck or not deck.facedown_stack.cards:
3982
3985
  return kernel
3983
3986
 
3987
+ updated_players = []
3984
3988
  for player in kernel.players:
3985
3989
  # Deal cards to the player's discard tray
3986
3990
  for _ in range(num_cards):
3987
3991
  if deck.facedown_stack.cards:
3988
3992
  card = deck.facedown_stack.cards.pop()
3989
- player.discard_tray.append(card)
3993
+ player = player.set(discard_tray=player.discard_tray.append(card))
3994
+ updated_players.append(player)
3990
3995
 
3991
- return kernel.set(players=kernel.players, decks=kernel.decks)
3996
+ return kernel.set(players=updated_players, decks=kernel.decks)
3992
3997
 
3993
3998
 
3994
3999
  @dispatch(StateKernel, int, int)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graph_games_proto
3
- Version: 0.3.2276
3
+ Version: 0.3.2292
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=3XawPcYk9Zk-Hj4M8eNBdGzBccKG8dWj8ZZGRkWnmA4,735
2
2
  graph_games_proto/all_types.py,sha256=IpbwftEcHS5Ewz-saFNk0lO9FvcbuHG36odRTayCXUk,54911
3
- graph_games_proto/fns.py,sha256=c7tdY79fni3W8faZh60jT-ecH1aE_DY4kex2gPFHI6Y,211095
3
+ graph_games_proto/fns.py,sha256=6wQFi338YbAi327ZA6d3DeID2cOQmVAsZgEEyD6fzPw,211350
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.2276.dist-info/METADATA,sha256=ajShthAweA4aD7Z819bMFrRP_NByfaefGX1y5oCVpUw,188
7
- graph_games_proto-0.3.2276.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
- graph_games_proto-0.3.2276.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
9
- graph_games_proto-0.3.2276.dist-info/RECORD,,
6
+ graph_games_proto-0.3.2292.dist-info/METADATA,sha256=suJq-St0A6vSKvjhX9KqN8qBBwObRL85M2I6zGA8V7w,188
7
+ graph_games_proto-0.3.2292.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
+ graph_games_proto-0.3.2292.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
9
+ graph_games_proto-0.3.2292.dist-info/RECORD,,