graph-games-proto 0.3.1905__py3-none-any.whl → 0.3.1907__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
@@ -4081,7 +4081,15 @@ def calc_legal_actions3(state_kernal):
4081
4081
  history = state_kernal.history
4082
4082
  last_action = history[-1] if len(history) > 0 else None
4083
4083
 
4084
- if last_action is None:
4084
+ if last_action is None or last_action.legal_action.name == "INITIAL-GOAL-KEEP":
4085
+ yet_to_make_initial_move = [
4086
+ player for player in state_kernal.players if len(player.discard_tray) > 0
4087
+ ]
4088
+
4089
+ if len(yet_to_make_initial_move) == 0:
4090
+ # All players have made their initial move, proceed to the first player's turn
4091
+ return get_default_legal_actions(state_kernal, state_kernal.player_idxs[0])
4092
+
4085
4093
  return [
4086
4094
  LegalAction(
4087
4095
  player_idx=player.idx,
@@ -4094,7 +4102,7 @@ def calc_legal_actions3(state_kernal):
4094
4102
  min=2,
4095
4103
  )
4096
4104
  )
4097
- for player in state_kernal.players
4105
+ for player in yet_to_make_initial_move
4098
4106
  ]
4099
4107
 
4100
4108
  elif last_action.legal_action.faceup_draw:
@@ -4127,9 +4135,6 @@ def calc_legal_actions3(state_kernal):
4127
4135
  )
4128
4136
  ]
4129
4137
 
4130
- if last_action.legal_action.name == "INITIAL-GOAL-KEEP":
4131
- return get_default_legal_actions(state_kernal, state_kernal.player_idxs[0])
4132
-
4133
4138
  next_player_idx = get_next_player_shuffled_idx(state_kernal, last_action)
4134
4139
  return get_default_legal_actions(state_kernal, state_kernal.player_idxs[next_player_idx])
4135
4140
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graph_games_proto
3
- Version: 0.3.1905
3
+ Version: 0.3.1907
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=_NOoU958Q_W5w40CBDIhaeg-h3V1E253NTvjOw2cii4,192148
3
+ graph_games_proto/fns.py,sha256=yZljahgFoJNzkWHfOPBgad2CdT56QI8vMJQeTqybQwQ,192427
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.1905.dist-info/METADATA,sha256=lnlzJE-qXiGmg9zk1VnkdSlnKHHzVwEJ1t1kcTZDTjM,188
7
- graph_games_proto-0.3.1905.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
- graph_games_proto-0.3.1905.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
9
- graph_games_proto-0.3.1905.dist-info/RECORD,,
6
+ graph_games_proto-0.3.1907.dist-info/METADATA,sha256=e3xWJ6-ge2xBQKysMVqOVZ6LQqFVbXJj6ZXtLFyR2AA,188
7
+ graph_games_proto-0.3.1907.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
+ graph_games_proto-0.3.1907.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
9
+ graph_games_proto-0.3.1907.dist-info/RECORD,,