MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / HandleEndOfGame

Method HandleEndOfGame

Sources/Main.cpp:2011–2027  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2009}
2010
2011void GameEventHandler::HandleEndOfGame(const LevelInitialization& levelInit, bool playerDied)
2012{
2013 const PlayerCarryOver* firstPlayer;
2014 std::size_t playerCount = levelInit.GetPlayerCount(&firstPlayer);
2015
2016 InGameConsole::Clear();
2017 auto mainMenu = std::make_shared<Menu::MainMenu>(this, false);
2018 if (playerCount == 1 && levelInit.IsLocalSession) {
2019 std::int32_t seriesIndex = Menu::HighscoresSection::TryGetSeriesIndex(levelInit.LastEpisodeName, playerDied);
2020 if (seriesIndex >= 0) {
2021 mainMenu->SwitchToSection<Menu::HighscoresSection>(seriesIndex, levelInit.Difficulty,
2022 levelInit.IsReforged, levelInit.CheatsUsed, levelInit.ElapsedMilliseconds, *firstPlayer);
2023 }
2024 }
2025
2026 SetStateHandler(std::move(mainMenu));
2027}
2028
2029void GameEventHandler::WriteCacheDescriptor(StringView path, std::uint64_t currentVersion, std::int64_t animsModified)
2030{

Callers 1

ChangeLevelMethod · 0.80

Calls 1

GetPlayerCountMethod · 0.80

Tested by

no test coverage detected