graph-games-proto 0.3.1900__py3-none-any.whl → 0.3.1901__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
@@ -4070,6 +4070,7 @@ def calc_legal_actions3(state_kernal):
4070
4070
 
4071
4071
 
4072
4072
  class StateKernal(PClass):
4073
+ game_config = field(type=GameConfig)
4073
4074
  edges = field(type=list) # List[BiEdge]
4074
4075
  decks = field(type=list) # List[Deck]
4075
4076
  piles = field(type=list) # List[Pile]
@@ -4077,14 +4078,17 @@ class StateKernal(PClass):
4077
4078
  player_idxs = field(type=list) # List[int]
4078
4079
  history = field(type=list) # List[PublicAction]
4079
4080
  player_scores = field(type=list) # List[PlayerScore]
4080
- game_config = field(type=GameConfig)
4081
4081
  uuid2edge = field(type=dict) # Dict[str, BiEdge]
4082
4082
  idx2path = field(type=list) # List[Path2]
4083
4083
  uuid2segment = field(type=dict) # Dict[str, Segment]
4084
4084
  edgeuuid2idx = field(type=dict) # Dict[str, int]
4085
+ carduuid2card = field(type=dict) # Dict[str, Card]
4085
4086
 
4086
4087
 
4087
4088
  def init_state_kernal(**kwargs):
4089
+ game_config = kwargs.get('game_config')
4090
+ fig = game_config.fig
4091
+ board_config = fig.board_config
4088
4092
  edges = kwargs.get('edges', [])
4089
4093
  uuid2edge = {}
4090
4094
  idx2path = []
@@ -4096,7 +4100,15 @@ def init_state_kernal(**kwargs):
4096
4100
  idx2path.append(path)
4097
4101
  for segment in path.segments:
4098
4102
  uuid2segment[segment.uuid] = segment
4103
+
4104
+ carduuid2card = {}
4105
+ for dek in board_config.deks:
4106
+ cards = generate_cards(dek)
4107
+ for card in cards:
4108
+ carduuid2card[card.uuid] = card
4109
+
4099
4110
  return StateKernal(
4111
+ game_config=game_config,
4100
4112
  edges=edges,
4101
4113
  decks=kwargs.get('decks'),
4102
4114
  piles=kwargs.get('piles'),
@@ -4104,11 +4116,11 @@ def init_state_kernal(**kwargs):
4104
4116
  player_idxs=kwargs.get('player_idxs'),
4105
4117
  history=kwargs.get('history'),
4106
4118
  player_scores=kwargs.get('player_scores'),
4107
- game_config=kwargs.get('game_config'),
4108
4119
  uuid2edge=uuid2edge,
4109
4120
  idx2path=idx2path,
4110
4121
  uuid2segment=uuid2segment,
4111
4122
  edgeuuid2idx=edgeuuid2idx,
4123
+ carduuid2card=carduuid2card,
4112
4124
  )
4113
4125
 
4114
4126
 
@@ -4124,6 +4136,7 @@ def getnextstate2(s, a, log=False):
4124
4136
  s = run_state_action_hooks(s, a, EMPTY_LEGAL_ACTIONS_HOOKS, log)
4125
4137
 
4126
4138
  state_kernal = init_state_kernal(
4139
+ game_config=s.game_config,
4127
4140
  edges=s.edges,
4128
4141
  decks=s.decks,
4129
4142
  piles=s.piles,
@@ -4131,7 +4144,6 @@ def getnextstate2(s, a, log=False):
4131
4144
  player_idxs=s.player_idxs,
4132
4145
  history=s.history,
4133
4146
  player_scores=s.player_scores,
4134
- game_config=s.game_config,
4135
4147
  )
4136
4148
  s = s.set(legal_actions_3=calc_legal_actions3(state_kernal))
4137
4149
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graph_games_proto
3
- Version: 0.3.1900
3
+ Version: 0.3.1901
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=UaOPciy5NGI80NFPQ7UkCAh76MTngEOQfwdd9v-Zgs4,187990
3
+ graph_games_proto/fns.py,sha256=7Ffq77o_6bB4uE-8zwmgeWj8B6J0Xf69YVWqAfMKg6M,188345
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.1900.dist-info/METADATA,sha256=AHrt9_-p3mdMs6pDQ0nrl_Vzly7iMgnU7IeqofXelbk,188
7
- graph_games_proto-0.3.1900.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
- graph_games_proto-0.3.1900.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
9
- graph_games_proto-0.3.1900.dist-info/RECORD,,
6
+ graph_games_proto-0.3.1901.dist-info/METADATA,sha256=Dgpx_JgPd1T7zH2mSEPUE39jIoQJF-lfD_iRCEzKNNc,188
7
+ graph_games_proto-0.3.1901.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
+ graph_games_proto-0.3.1901.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
9
+ graph_games_proto-0.3.1901.dist-info/RECORD,,