tresinformal / drakkar

The tresinformal video game called 'Drakkar'
GNU General Public License v3.0
11 stars 4 forks source link

The Results screen shows up when time is up, not before #719

Open TheoPannetier opened 1 year ago

TheoPannetier commented 1 year ago

Depends

Context

Once the results screen exists, we should make sure that it is displayed once the game is over and not before.

Test

Here is a draft for the test, please edit/complete when it is clearer what form the results screen can take.

  // (719) The results screen is displayed when time is up, not before
  {
    const int time_limit = 10;
    const game_options g_options{3,
                          false,
                          get_random_kam(),
                          get_random_kam(),
                          get_random_kam(),
                          environment_type(),
                          time_limit
                         };
    game_view gv{g_options};
    for (int i = 0; i < time_limit; i++)
      {
        assert(!gv.get_results_screen().is_visible());
        gv.get_game().tick();
      }
    assert(gv.get_results_screen().is_visible());
  }
  #endif // FIX_ISSUE_719