graph-games-proto 0.3.2113__py3-none-any.whl → 0.3.2117__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
@@ -1215,14 +1215,12 @@ class LegalActionKeep(PClass):
1215
1215
  ]
1216
1216
  num_cards = len(card_uuids_matching_deck)
1217
1217
  actual_min = 0 if legal_action.keep.min is None else legal_action.keep.min
1218
- actual_max = num_cards if legal_action.keep.max is None else min(legal_action.keep.max, num_cards)
1219
- rand_num_chosen = state.kernel.rng.randint(actual_min, actual_max)
1220
- card_uuids = card_uuids_matching_deck[0:rand_num_chosen]
1218
+ # actual_max = num_cards if legal_action.keep.max is None else min(legal_action.keep.max, num_cards)
1221
1219
  return Action2(
1222
1220
  submitted_at=submitted_at,
1223
1221
  legal_action=legal_action,
1224
1222
  keep=ActionKeep(
1225
- card_uuids=card_uuids
1223
+ discard_tray_idxs=list(range(actual_min)),
1226
1224
  )
1227
1225
  )
1228
1226
 
@@ -1732,6 +1730,20 @@ class Deck(PClass):
1732
1730
  )
1733
1731
 
1734
1732
 
1733
+ class CandidateDeck(PClass):
1734
+ deck_idx = field(type=int)
1735
+ candidates = field(type=list) # List[Card]
1736
+ def __todict__(self):
1737
+ return {
1738
+ 'deck_idx': self.deck_idx,
1739
+ 'candidates': [card.__todict__() for card in self.candidates],
1740
+ }
1741
+ @staticmethod
1742
+ def __fromdict__(d):
1743
+ return CandidateDeck(
1744
+ deck_idx=d["deck_idx"],
1745
+ candidates=[Card.__fromdict__(card) for card in d["candidates"]],
1746
+ )
1735
1747
 
1736
1748
 
1737
1749
  class Card(PClass):
@@ -4663,7 +4675,7 @@ def get_candidate_decks(ps: PlayerState) -> List[CandidateDeck]:
4663
4675
 
4664
4676
 
4665
4677
  def imagine_player(p_idx: int, ps: PlayerState, candidate_decks: List[CandidateDeck]) -> Player:
4666
- if ps.private.player.idx ===p_idx:
4678
+ if ps.private.player.idx == p_idx:
4667
4679
  return ps.private.player
4668
4680
  public_player = ps.public.players[p_idx]
4669
4681
  cards = []
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graph_games_proto
3
- Version: 0.3.2113
3
+ Version: 0.3.2117
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=t0ghADefUKH3eq4SjRPeuQ-fxQxz4HvuioYrPzBsAqU,204955
3
+ graph_games_proto/fns.py,sha256=-h-D3oVPRfVM7o_bt4DAsObBBc6dErf_I1N_6nb5f7Y,205315
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.2113.dist-info/METADATA,sha256=hRb9YGXOkZ1D0j0Ix5Z8III2hBXE7_ShDdGUPS-SBu8,188
7
- graph_games_proto-0.3.2113.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
- graph_games_proto-0.3.2113.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
9
- graph_games_proto-0.3.2113.dist-info/RECORD,,
6
+ graph_games_proto-0.3.2117.dist-info/METADATA,sha256=L47IoRHXE3jlzuonybqH4fLJ899bPu7yOuAuZKlSkHU,188
7
+ graph_games_proto-0.3.2117.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
+ graph_games_proto-0.3.2117.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
9
+ graph_games_proto-0.3.2117.dist-info/RECORD,,