wavelength 1.0.0
Loading...
Searching...
No Matches
WorldMgr Class Reference

Driver of the World that is loading, running, or being torn down. More...

#include <worldmgr.h>

Public Types

enum  State { kStateIdle = 0 , kStateLoading = 1 , kStatePlaying = 2 , kStateUnloaded = 3 }
 Values of mState. More...
enum  Event {
  kEventNone = 0 , kEventLoaded = 1 , kEventFinished = 2 , kEventUnloaded = 3 ,
  kEventRestart = 4
}
 Values Poll() reports. More...

Public Member Functions

 WorldMgr ()
 Construct the driver with every member clear.
 ~WorldMgr ()
 Release the driver.
void Init ()
 Initialise TheGfxManager and TheGameConfig, and mark the driver initialised.
void Terminate ()
 Destroy the world and the router if either exists, and shut down TheGfxManager.
int GetState () const
 Report mState.
void Reset ()
 Reset TheGfxManager and enter kStateIdle.
void Load ()
 Build the World for the selected rule set and enter kStateLoading.
void Start ()
 Attach an InputMgr to the loaded world and enter kStatePlaying.
void Unload ()
 Destroy the router and the world and enter kStateUnloaded.
void UpdateTime ()
 Copy two timing values of the running world into the game database.
int Poll ()
 Advance the current state by one frame and report what changed.
void Draw ()
 Draw TheGfxManager, at the running world's tick or at time 0 otherwise.

Static Public Member Functions

static WorldMgr * shared ()
 Report the single instance, constructing it on first use.

Detailed Description

Driver of the World that is loading, running, or being torn down.

The class is not polymorphic and has no RTTI, and the name is inferred from the members it manages. The one instance is the function-local static of shared(), and TheWorldMgr addresses it.

Load() builds the World subclass for the rule set the game database selects, Start() attaches an InputMgr, and Unload() destroys both. Poll() advances the state each frame and reports what changed as an Event.

Load(), Start(), Unload(), and Reset() each time their body on a stack Timer. The measurement is never read.

Member Enumeration Documentation

◆ State

Values of mState.

Enumerator
kStateIdle 

No world exists.

kStateLoading 

A world is loading its assets.

kStatePlaying 

The world is running with input attached.

kStateUnloaded 

The world was destroyed and the display is changing back.

◆ Event

Values Poll() reports.

Enumerator
kEventNone 

Nothing changed.

kEventLoaded 

The loading world is ready to start.

kEventFinished 

The running world ended.

kEventUnloaded 

The display finished changing after Unload().

kEventRestart 

The running world ended and requested a restart.

Constructor & Destructor Documentation

◆ WorldMgr()

WorldMgr::WorldMgr ( )

Construct the driver with every member clear.

Ghidra address:
NTSC-U/C: 0x00104878
Ghidra address:
PAL: 0x00105f60

◆ ~WorldMgr()

WorldMgr::~WorldMgr ( )

Release the driver.

The body is empty, and the world and the router are not destroyed.

Ghidra address:
NTSC-U/C: 0x00104898
Ghidra address:
PAL: 0x00105f80

Member Function Documentation

◆ shared()

WorldMgr * WorldMgr::shared ( )
static

Report the single instance, constructing it on first use.

Returns
The instance.
Ghidra address:
NTSC-U/C: 0x001049a0
Ghidra address:
PAL: 0x00106088

◆ Init()

void WorldMgr::Init ( )

Initialise TheGfxManager and TheGameConfig, and mark the driver initialised.

Ghidra address:
NTSC-U/C: 0x001048c0
Ghidra address:
PAL: 0x00105fa8

◆ Terminate()

void WorldMgr::Terminate ( )

Destroy the world and the router if either exists, and shut down TheGfxManager.

The two pointers are not cleared.

Ghidra address:
NTSC-U/C: 0x00104900
Ghidra address:
PAL: 0x00105fe8

◆ GetState()

int WorldMgr::GetState ( ) const

Report mState.

Returns
One of State.
Ghidra address:
NTSC-U/C: 0x001049f8
Ghidra address:
PAL: 0x001060e0

◆ Reset()

void WorldMgr::Reset ( )

Reset TheGfxManager and enter kStateIdle.

Ghidra address:
NTSC-U/C: 0x00104a00
Ghidra address:
PAL: 0x001060e8

◆ Load()

void WorldMgr::Load ( )

Build the World for the selected rule set and enter kStateLoading.

Rule set 1 builds a Game, rule set 2 a Remix, and rule set 3 a Duel. Any other value builds no world and passes "invalid ruleset" to DebugWarn(). The periodic controller check is turned off until Unload().

Ghidra address:
NTSC-U/C: 0x00104a70
Ghidra address:
PAL: 0x00106158

◆ Start()

void WorldMgr::Start ( )

Attach an InputMgr to the loaded world and enter kStatePlaying.

Ghidra address:
NTSC-U/C: 0x00104bb8
Ghidra address:
PAL: 0x001062a0

◆ Unload()

void WorldMgr::Unload ( )

Destroy the router and the world and enter kStateUnloaded.

Ghidra address:
NTSC-U/C: 0x00104c50
Ghidra address:
PAL: 0x00106338

◆ UpdateTime()

void WorldMgr::UpdateTime ( )

Copy two timing values of the running world into the game database.

Only a world in kStatePlaying publishes. The main loop calls the routine first in each frame. The name is inferred.

Ghidra address:
NTSC-U/C: 0x00104d20
Ghidra address:
PAL: 0x00106408

◆ Poll()

int WorldMgr::Poll ( )

Advance the current state by one frame and report what changed.

The pending event is cleared as it is reported.

Returns
One of Event.
Ghidra address:
NTSC-U/C: 0x00104d88
Ghidra address:
PAL: 0x00106470

◆ Draw()

void WorldMgr::Draw ( )

Draw TheGfxManager, at the running world's tick or at time 0 otherwise.

Ghidra address:
NTSC-U/C: 0x00104ef0
Ghidra address:
PAL: 0x001065d8

The documentation for this class was generated from the following file: