Isle
Loading...
Searching...
No Matches
RaceState Class Reference

[AI] Maintains persistent information about race progress, results, and high scores for up to five races. More...

#include <legorace.h>

Inheritance diagram for RaceState:
Collaboration diagram for RaceState:

Classes

struct  Entry
 [AI] Entry for an individual race event/state, holding its identifier, unknown field, and score. More...
 

Public Member Functions

 RaceState ()
 [AI] Constructs a RaceState, initializing all races with default values and IDs (1 through 5). More...
 
const char * ClassName () const override
 [AI] Returns the class name of the RaceState object ("RaceState"). More...
 
MxBool IsA (const char *p_name) const override
 [AI] Checks if the object is exactly a RaceState or derived thereof, using class name string comparison (including parent LegoState). More...
 
MxResult Serialize (LegoStorage *p_storage) override
 [AI] Serializes all race state entries to or from the given storage object. More...
 
EntryGetState (MxU8 p_id)
 [AI] Fetches a race state entry matching the given entry ID, or NULL if not found in the array. More...
 
- Public Member Functions inherited from LegoState
 ~LegoState () override
 [AI] Virtual destructor to allow subclass cleanup. More...
 
virtual MxBool IsSerializable ()
 [AI] Returns if this state can be serialized (for game saving/loading support). More...
 
virtual MxBool Reset ()
 [AI] Hook for returning object to default (empty) state; not implemented in this base. More...
 
virtual MxResult Serialize (LegoStorage *p_storage)
 [AI] Serialize state to a storage (for save/load). More...
 
const char * ClassName () const override
 [AI] Gets this class's name for RTTI/IsA functionality. More...
 
MxBool IsA (const char *p_name) const override
 [AI] Tests if this object is of a given class name, directly or through inheritance. More...
 
- Public Member Functions inherited from MxCore
 MxCore ()
 [AI] Constructs a new MxCore object and assigns it a unique id. More...
 
virtual ~MxCore ()
 [AI] Virtual destructor. Required for correct polymorphic cleanup in derived classes. More...
 
virtual MxLong Notify (MxParam &p_param)
 [AI] Virtual callback notification mechanism. More...
 
virtual MxResult Tickle ()
 [AI] Called by tickle managers to allow the object to update itself. More...
 
virtual const char * ClassName () const
 [AI] Returns the runtime class name of this object. More...
 
virtual MxBool IsA (const char *p_name) const
 [AI] Checks whether this object's class type or parents match the given name. More...
 
MxU32 GetId ()
 [AI] Gets the unique (per-process) id assigned to this object instance. More...
 

Public Attributes

Entry m_state [5]
 [AI] Entries for each tracked race/state (IDs 1..5). More...
 
undefined4 m_unk0x28
 [AI] Unknown extra field, always initialized to zero. More...
 

Additional Inherited Members

- Public Types inherited from LegoState
enum  ScoreColor { e_grey = 0 , e_yellow , e_blue , e_red }
 [AI] Score coloring values for in-game display feedback or logic. More...
 

Detailed Description

[AI] Maintains persistent information about race progress, results, and high scores for up to five races.

Used as a state class for the race area in LEGO Island. Handles serialization of results and maintains race-specific entries.

Inherits from LegoState. [AI]

Definition at line 28 of file legorace.h.

Constructor & Destructor Documentation

◆ RaceState()

RaceState::RaceState ( )

[AI] Constructs a RaceState, initializing all races with default values and IDs (1 through 5).

[AI]

Definition at line 116 of file legorace.cpp.

Member Function Documentation

◆ ClassName()

const char * RaceState::ClassName ( ) const
inlineoverridevirtual

[AI] Returns the class name of the RaceState object ("RaceState").

Returns
String literal "RaceState". [AI]

Reimplemented from MxCore.

Definition at line 98 of file legorace.h.

◆ GetState()

RaceState::Entry * RaceState::GetState ( MxU8  p_id)

[AI] Fetches a race state entry matching the given entry ID, or NULL if not found in the array.

Parameters
p_idThe ID to search for (should be 1-5). [AI]
Returns
Pointer to the corresponding Entry, or NULL if not present. [AI]

Definition at line 151 of file legorace.cpp.

◆ IsA()

MxBool RaceState::IsA ( const char *  p_name) const
inlineoverridevirtual

[AI] Checks if the object is exactly a RaceState or derived thereof, using class name string comparison (including parent LegoState).

Parameters
p_nameName of type for comparison. [AI]
Returns
TRUE if this or ancestor class matches p_name, FALSE otherwise. [AI]

Reimplemented from MxCore.

Definition at line 110 of file legorace.h.

◆ Serialize()

MxResult RaceState::Serialize ( LegoStorage p_storage)
overridevirtual

[AI] Serializes all race state entries to or from the given storage object.

[AI]

Parameters
p_storageStorage for reading/writing state. [AI]
Returns
SUCCESS if serialization completed. [AI]

Reimplemented from LegoState.

Definition at line 138 of file legorace.cpp.

Member Data Documentation

◆ m_state

Entry RaceState::m_state[5]

[AI] Entries for each tracked race/state (IDs 1..5).

Definition at line 137 of file legorace.h.

◆ m_unk0x28

undefined4 RaceState::m_unk0x28

[AI] Unknown extra field, always initialized to zero.

Definition at line 138 of file legorace.h.


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