Jazz2::LevelInitialization struct

Level initialization parameters.

Describes which level to start and under what conditions — target level name, difficulty, session/reforged flags, last exit type, elapsed time and the per-player PlayerCarryOver entries. Passed to the root controller to change level and consumed by the level handler when spawning players.

Constructors, destructors, conversion operators

LevelInitialization()
Creates a new instance.
LevelInitialization(StringView level, GameDifficulty difficulty, bool isReforged)
Creates a new instance for a given level.
LevelInitialization(StringView level, GameDifficulty difficulty, bool isReforged, bool cheatsUsed, PlayerType playerType)
Creates a new instance for a given level and a single player.
LevelInitialization(StringView level, GameDifficulty difficulty, bool isReforged, bool cheatsUsed, ArrayView<const PlayerType> playerTypes)
Creates a new instance for a given level and multiple players.
LevelInitialization(const LevelInitialization& copy) noexcept
Copy constructor.
LevelInitialization(LevelInitialization&& move) noexcept
Move constructor.

Public functions

auto GetPlayerCount(const PlayerCarryOver** firstPlayer = nullptr) const -> std::int32_t
Returns number of assigned players.

Public variables

String LevelName
Level name in <episode>/<level> format.
String LastEpisodeName
Last episode name.
bool IsLocalSession
Whether the session is local (not online).
std::uint8_t LocalMultiplayerGameMode
Game mode of a local splitscreen multiplayer session (value of Multiplayer::MpGameMode); Multiplayer::MpGameMode::Unknown (the default) marks a plain single-player local session that uses the base level handler, anything else selects the local Multiplayer::MpLevelHandler running that mode.
GameDifficulty Difficulty
Difficulty.
bool IsReforged
Whether reforged gameplay is enabled.
bool CheatsUsed
Whether cheats were used.
ExitType LastExitType
Last exit type.
std::uint64_t ElapsedMilliseconds
Elapsed milliseconds (gameplay time).
StaticArray<MaxPlayerCount, PlayerCarryOver> PlayerCarryOvers
Player carry over descriptions.

Constants

static std::int32_t MaxPlayerCount constexpr
Maximum player count.
static std::int32_t DefaultLives constexpr
Default number of lives.

Function documentation

Jazz2::LevelInitialization::LevelInitialization(StringView level, GameDifficulty difficulty, bool isReforged)

Creates a new instance for a given level.

Parameters
level Level name in <episode>/<level> format
difficulty Difficulty
isReforged Whether reforged gameplay is enabled

Jazz2::LevelInitialization::LevelInitialization(StringView level, GameDifficulty difficulty, bool isReforged, bool cheatsUsed, PlayerType playerType)

Creates a new instance for a given level and a single player.

Parameters
level Level name in <episode>/<level> format
difficulty Difficulty
isReforged Whether reforged gameplay is enabled
cheatsUsed Whether cheats were used
playerType Type of the player

Jazz2::LevelInitialization::LevelInitialization(StringView level, GameDifficulty difficulty, bool isReforged, bool cheatsUsed, ArrayView<const PlayerType> playerTypes)

Creates a new instance for a given level and multiple players.

Parameters
level Level name in <episode>/<level> format
difficulty Difficulty
isReforged Whether reforged gameplay is enabled
cheatsUsed Whether cheats were used
playerTypes Types of the players