graph-games-proto 0.3.1901__py3-none-any.whl → 0.3.1903__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
@@ -4062,8 +4062,8 @@ def calc_legal_actions3(state_kernal):
4062
4062
  return get_default_legal_actions(state_kernal, state_kernal.player_idxs[0])
4063
4063
  else:
4064
4064
  last_player_idx = last_action.legal_action.player_idx
4065
- last_player_shuffled_idx = last_action.player_idxs.index(last_player_idx)
4066
- next_player_shuffled_idx = (last_player_shuffled_idx + 1) % len(last_action.player_idxs)
4065
+ last_player_shuffled_idx = state_kernal.player_idxs.index(last_player_idx)
4066
+ next_player_shuffled_idx = (last_player_shuffled_idx + 1) % len(state_kernal.player_idxs)
4067
4067
  return get_default_legal_actions(state_kernal, state_kernal.player_idxs[next_player_shuffled_idx])
4068
4068
 
4069
4069
  return []
@@ -4081,6 +4081,7 @@ class StateKernal(PClass):
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
+ pieceuuid2piece = field(type=dict) # Dict[str, Piece]
4084
4085
  edgeuuid2idx = field(type=dict) # Dict[str, int]
4085
4086
  carduuid2card = field(type=dict) # Dict[str, Card]
4086
4087
 
@@ -4100,7 +4101,13 @@ def init_state_kernal(**kwargs):
4100
4101
  idx2path.append(path)
4101
4102
  for segment in path.segments:
4102
4103
  uuid2segment[segment.uuid] = segment
4103
-
4104
+ pieceuuid2piece = {}
4105
+ for piece_template in board_config.piece_templates:
4106
+ if piece_template.has_player:
4107
+ for player_idx in range(game_config.num_players):
4108
+ pieces = generate_pieces(piece_template, player_idx)
4109
+ for piece in pieces:
4110
+ pieceuuid2piece[piece.uuid] = piece
4104
4111
  carduuid2card = {}
4105
4112
  for dek in board_config.deks:
4106
4113
  cards = generate_cards(dek)
@@ -4121,6 +4128,7 @@ def init_state_kernal(**kwargs):
4121
4128
  uuid2segment=uuid2segment,
4122
4129
  edgeuuid2idx=edgeuuid2idx,
4123
4130
  carduuid2card=carduuid2card,
4131
+ pieceuuid2piece=pieceuuid2piece,
4124
4132
  )
4125
4133
 
4126
4134
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graph_games_proto
3
- Version: 0.3.1901
3
+ Version: 0.3.1903
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=7Ffq77o_6bB4uE-8zwmgeWj8B6J0Xf69YVWqAfMKg6M,188345
3
+ graph_games_proto/fns.py,sha256=-HdoYLzKIAD3bPr2dRi-gRGxczpURJWnAZfmD8l2fLI,188789
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.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,,
6
+ graph_games_proto-0.3.1903.dist-info/METADATA,sha256=Vop_4aj3LFBA8cDiI3i07Q7fE4jYBL3X2eNvYjRuYiM,188
7
+ graph_games_proto-0.3.1903.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
+ graph_games_proto-0.3.1903.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
9
+ graph_games_proto-0.3.1903.dist-info/RECORD,,