graph-games-proto 0.3.1701__py3-none-any.whl → 0.3.1702__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
@@ -1514,34 +1514,34 @@ class ActionMovePiecesToPathOptional(PClass):
1514
1514
 
1515
1515
 
1516
1516
  class PublicLegalActionMovePiecesToPath(PClass):
1517
- path_idx = field(type=int)
1517
+ path_uuid = field(type=str)
1518
1518
  def __todict__(self):
1519
1519
  return {
1520
- "path_idx": self.path_idx
1520
+ "path_uuid": self.path_uuid,
1521
1521
  }
1522
1522
  @staticmethod
1523
1523
  def __fromdict__(d):
1524
1524
  return PublicLegalActionMovePiecesToPath(
1525
- path_idx=d["path_idx"]
1525
+ path_uuid=d["path_uuid"]
1526
1526
  )
1527
1527
 
1528
1528
 
1529
1529
  class LegalActionMovePiecesToPath(PClass):
1530
- path_idx = field(type=int)
1530
+ path_uuid = field(type=str)
1531
1531
  default = field(type=ActionMovePiecesToPathOptional) # Optional[MovePiecesToPathAction]
1532
1532
  def get_public(self, state):
1533
1533
  return PublicLegalActionMovePiecesToPath(
1534
- path_idx=self.path_idx,
1534
+ path_uuid=self.path_uuid,
1535
1535
  )
1536
1536
  def __todict__(self):
1537
1537
  return {
1538
- "path_idx": self.path_idx,
1538
+ "path_uuid": self.path_uuid,
1539
1539
  "default": self.default.__todict__(),
1540
1540
  }
1541
1541
  @staticmethod
1542
1542
  def __fromdict__(d):
1543
1543
  return LegalActionMovePiecesToPath(
1544
- path_idx=d["path_idx"],
1544
+ path_uuid=d["path_uuid"],
1545
1545
  default=ActionMovePiecesToPathOptional.__fromdict__(d["default"])
1546
1546
  )
1547
1547
  @staticmethod
@@ -3501,8 +3501,8 @@ def handle_move_pieces_to_path_action(game, action):
3501
3501
  if not player or not player.pieces:
3502
3502
  return game
3503
3503
 
3504
- path_idx = move_pieces_to_path.path_idx
3505
- path = get_path_by_idx(game, path_idx)
3504
+ path_uuid = move_pieces_to_path.path_uuid
3505
+ path = game.uuid2path[path_uuid]
3506
3506
 
3507
3507
  if path is None or not path.segments:
3508
3508
  return game
@@ -3525,8 +3525,8 @@ def handle_move_pieces_to_path_action(game, action):
3525
3525
  game.decks[game.carduuid2card[card_uuid].deck_idx].discard.append(card_uuid)
3526
3526
 
3527
3527
  game = game.set(players=game.players)
3528
- game = game.set(edges=game.edges)
3529
- game = game.set(player_graphs=calc_player_graphs(game)) #
3528
+ game = game.set(uuid2path=game.uuid2path)
3529
+ game = game.set(player_graphs=calc_player_graphs(game)) #
3530
3530
 
3531
3531
  return game
3532
3532
 
@@ -3791,11 +3791,11 @@ def is_move_pieces_to_path_action_legal(game, action):
3791
3791
  # print("******************************1234 is_move_pieces_to_path_action_legal 1")
3792
3792
  player_idx = action.legal_action.player_idx
3793
3793
  proposed_cards_uuids = action.move_pieces_to_path.card_uuids
3794
- path_idx = action.legal_action.move_pieces_to_path.path_idx
3795
- path = game.game_config.fig.board_config.board_paths[path_idx]
3794
+ path_uuid = action.legal_action.move_pieces_to_path.path_uuid
3795
+ path = game.uuid2path[path_uuid]
3796
3796
  proposed_cards = [card_uuid for card_uuid in game.players[player_idx].cards if card_uuid in proposed_cards_uuids]
3797
3797
  proposed_pieces = [piece_uuid for piece_uuid in game.players[player_idx].pieces if piece_uuid in action.move_pieces_to_path.piece_uuids]
3798
- remaining_segments = path.path.segments
3798
+ remaining_segments = path.segments
3799
3799
 
3800
3800
  # print("******************************1234 is_move_pieces_to_path_action_legal 1b: ", proposed_cards)
3801
3801
  # print("******************************1234 is_move_pieces_to_path_action_legal 1c: ", proposed_pieces)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graph_games_proto
3
- Version: 0.3.1701
3
+ Version: 0.3.1702
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=LOpk1mGZxPWMRGrPNoXDENn7JPG6rNfhieehItW8bEA,881
2
2
  graph_games_proto/all_types.py,sha256=IpbwftEcHS5Ewz-saFNk0lO9FvcbuHG36odRTayCXUk,54911
3
- graph_games_proto/fns.py,sha256=VhyabYcA34Oo4QNUHLPVXCnf050jj3PI3pP1IYz6-aU,264543
3
+ graph_games_proto/fns.py,sha256=16684x3Fre-z3qXrXCF4RCDhkESjGJ_-Tim-AmVFvgk,264526
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.1701.dist-info/METADATA,sha256=72HOO9KiT8Eg17THvFR0FNTXLo1WL2JjD_6FN64m_gE,188
7
- graph_games_proto-0.3.1701.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
- graph_games_proto-0.3.1701.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
9
- graph_games_proto-0.3.1701.dist-info/RECORD,,
6
+ graph_games_proto-0.3.1702.dist-info/METADATA,sha256=miFHpsrtSUCKDs5w82i3b1f8XeoHGWtIwWgSc5Muc40,188
7
+ graph_games_proto-0.3.1702.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
+ graph_games_proto-0.3.1702.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
9
+ graph_games_proto-0.3.1702.dist-info/RECORD,,