Jazz2::IRootController class

Base interface of a root controller.

Top-level application controller that owns the active state handler and drives transitions between them (main menu, levels), manages resumable state, exposes async invocation, and on supported builds connects to or hosts a multiplayer server.

Public types

enum class Flags { None = 0x00, IsInitialized = 0x01, IsVerified = 0x02, IsPlayable = 0x04 }
State flags of root controller, supports a bitwise combination of its member values.

Constructors, destructors, conversion operators

IRootController()
Creates a new instance.
~IRootController() virtual
IRootController(const IRootController&) deleted

Public functions

auto operator=(const IRootController&) -> IRootController& deleted
void InvokeAsync(Function<void()>&& callback) pure virtual
Invokes the specified callback asynchronously, usually at the end of current frame.
void InvokeAsync(std::weak_ptr<void> reference, Function<void()>&& callback) pure virtual
void GoToMainMenu(bool afterIntro) pure virtual
Sets current state handler to main menu.
void ChangeLevel(LevelInitialization&& levelInit) pure virtual
Sets current state handler to level described by LevelInitialization.
auto HasResumableState() const -> bool pure virtual
Returns true if any resumable state exists.
void ResumeSavedState() pure virtual
Resumes saved resumable state.
auto SaveCurrentStateIfAny() -> bool pure virtual
Saves current state if it's resumable.
auto GetFlags() const -> Flags pure virtual
Returns current state flags.
auto GetNewestVersion() const -> StringView pure virtual
Returns version of the latest update.
void RefreshCacheLevels(bool recreateAll) pure virtual
Recreates level cache from Source directory.

Enum documentation

enum class Jazz2::IRootController::Flags

State flags of root controller, supports a bitwise combination of its member values.

Enumerators
None

None

IsInitialized

The controller has been initialized

IsVerified

The assets have been verified

IsPlayable

The game is playable

Function documentation

void Jazz2::IRootController::InvokeAsync(std::weak_ptr<void> reference, Function<void()>&& callback) pure virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.