Commit 599b182 Robert Lukoťka
committed
1 parent b22cc06 commit 599b182 Copy full SHA for 599b182
File tree 2 files changed +20
-1
lines changed
stone_age/game_phase_controller
test/game_phase_controller
2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,8 @@ def _try_to_do_further_actions(self) -> None:
123
123
first_unsuccesful_player = None
124
124
self ._progress_state_after_succesfull_action ()
125
125
case HasAction .NO_ACTION_POSSIBLE :
126
- if first_unsuccesful_player is None :
126
+ game_phase_match : bool = unsuccesful_game_phase == self ._game_phase
127
+ if first_unsuccesful_player is None or not game_phase_match :
127
128
first_unsuccesful_player = player
128
129
unsuccesful_game_phase = self ._game_phase
129
130
self ._progress_state_after_no_action_possible ()
Original file line number Diff line number Diff line change @@ -301,6 +301,24 @@ def test_all_players_take_a_reward(self) -> None:
301
301
self .assertTrue (self .make_all_players_take_a_reward_choice (1 ))
302
302
self .check_state_string ("GamePhase.MAKE_ACTION,0/1/None" )
303
303
304
+ def test_no_tools_last_action (self ) -> None :
305
+ self .mock_setup ("pDNN mW" )
306
+ self .assertTrue (self .place_figures (0 ))
307
+ self .check_state_string ("GamePhase.MAKE_ACTION,0/0/None" )
308
+
309
+ self .mock_setup ("mT wN mNN fW" )
310
+ self .assertTrue (self .make_action (0 ))
311
+ self .check_state_string ("GamePhase.FEED_TRIBE,0/0/None" )
312
+
313
+ def test_all_players_take_a_reward_last_action (self ) -> None :
314
+ self .mock_setup ("pDNN mW" )
315
+ self .assertTrue (self .place_figures (0 ))
316
+ self .check_state_string ("GamePhase.MAKE_ACTION,0/0/None" )
317
+
318
+ self .mock_setup ("mR aN mNN fW" )
319
+ self .assertTrue (self .make_action (0 ))
320
+ self .check_state_string ("GamePhase.FEED_TRIBE,0/0/None" )
321
+
304
322
305
323
if __name__ == "__main__" :
306
324
unittest .main ()
You can’t perform that action at this time.
0 commit comments