NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches

#include <game/bases/d_center_save_mng.hpp>

Description

A manager for saving and restoring rotation state of daObjCenter2_c actors.

Definition at line 7 of file d_center_save_mng.hpp.

Classes

class  Entry_c
 An entry in the rotation state manager. More...

Public Member Functions

 dCenterSaveMng_c ()
 Constructs a new manager.
 ~dCenterSaveMng_c ()
 Destroys the manager.
bool center_check (const mVec3_c *pos, u8 id, short *outRotation)
 Tries to restore the rotation from a given position and ID.
void center_entry (const mVec3_c *pos, u8 id, short rotation)
 Saves the rotation state for a given position and ID.

Static Public Attributes

static dCenterSaveMng_c * m_instance
 The singleton instance of the manager.
static cLineMg_c ms_linkManager
 The linked list manager for the saved rotation states.

Static Private Member Functions

static void allDoDelete ()
 Clears all saved rotation states.

Constructor & Destructor Documentation

◆ dCenterSaveMng_c()

dCenterSaveMng_c::dCenterSaveMng_c ( )

Constructs a new manager.

Definition at line 6 of file d_center_save_mng.cpp.

◆ ~dCenterSaveMng_c()

dCenterSaveMng_c::~dCenterSaveMng_c ( )

Destroys the manager.

Definition at line 10 of file d_center_save_mng.cpp.

Member Function Documentation

◆ center_check()

bool dCenterSaveMng_c::center_check ( const mVec3_c * pos,
u8 id,
short * outRotation )

Tries to restore the rotation from a given position and ID.

Parameters
posThe position to check.
idThe ID to check.
outRotationThe output rotation value if a match is found.
Returns
Whether a rotation was found and restored.

Definition at line 26 of file d_center_save_mng.cpp.

◆ center_entry()

void dCenterSaveMng_c::center_entry ( const mVec3_c * pos,
u8 id,
short rotation )

Saves the rotation state for a given position and ID.

Parameters
posThe position to save.
idThe ID to save.
rotationThe rotation value to save.

Definition at line 46 of file d_center_save_mng.cpp.

◆ allDoDelete()

void dCenterSaveMng_c::allDoDelete ( )
staticprivate

Clears all saved rotation states.

Definition at line 15 of file d_center_save_mng.cpp.

Member Data Documentation

◆ m_instance

dCenterSaveMng_c * dCenterSaveMng_c::m_instance
static

The singleton instance of the manager.

Definition at line 52 of file d_center_save_mng.hpp.

◆ ms_linkManager

cLineMg_c dCenterSaveMng_c::ms_linkManager
static

The linked list manager for the saved rotation states.

Definition at line 53 of file d_center_save_mng.hpp.