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

[AI] Base class for game state blocks which encapsulate serializable and/or resettable aspects of the game's state. More...

#include <legostate.h>

Inheritance diagram for LegoState:
Collaboration diagram for LegoState:

Classes

struct  Playlist
 [AI] Playlist structure representing an indexed list of object IDs with next-item selection strategies (loop, once, random etc). More...
 

Public Types

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

Public Member Functions

 ~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...
 

Detailed Description

[AI] Base class for game state blocks which encapsulate serializable and/or resettable aspects of the game's state.

[AI]

LegoState is a polymorphic base for objects representing state relevant to LEGO Island's scripting/game logic. It allows derived states to be serialized, reset, and identifies themselves via RTTI-style interface. [AI]

Definition at line 17 of file legostate.h.

Member Enumeration Documentation

◆ ScoreColor

[AI] Score coloring values for in-game display feedback or logic.

[AI]

Enumerator
e_grey 

[AI] Default/neutral color (0) [AI]

e_yellow 

[AI] First colored highlight (1) [AI]

e_blue 

[AI] Second color, e.g. better score (2) [AI]

e_red 

[AI] Warning/critical color (3) [AI]

Definition at line 22 of file legostate.h.

Constructor & Destructor Documentation

◆ ~LegoState()

LegoState::~LegoState ( )
inlineoverride

[AI] Virtual destructor to allow subclass cleanup.

[AI]

Definition at line 117 of file legostate.h.

Member Function Documentation

◆ ClassName()

const char * LegoState::ClassName ( ) const
inlineoverridevirtual

[AI] Gets this class's name for RTTI/IsA functionality.

[AI]

Returns
Always returns "LegoState" string [AI]

Reimplemented from MxCore.

Reimplemented in PizzaMissionState, PizzeriaState, PoliceState, RadioState, ScoreState, and TowTrackMissionState.

Definition at line 155 of file legostate.h.

◆ IsA()

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

[AI] Tests if this object is of a given class name, directly or through inheritance.

[AI]

Parameters
p_nameClass name string to compare [AI]
Returns
TRUE if matches this class or any ancestor [AI]

Reimplemented from MxCore.

Reimplemented in PizzaMissionState, PizzeriaState, PoliceState, RadioState, ScoreState, and TowTrackMissionState.

Definition at line 169 of file legostate.h.

◆ IsSerializable()

virtual MxBool LegoState::IsSerializable ( )
inlinevirtual

[AI] Returns if this state can be serialized (for game saving/loading support).

[AI]

Returns
TRUE if serializable, overrides can return FALSE [AI]

Reimplemented in Act3State, HelicopterState, InfocenterState, JukeBoxState, LegoAct2State, RadioState, and ScoreState.

Definition at line 124 of file legostate.h.

◆ Reset()

virtual MxBool LegoState::Reset ( )
inlinevirtual

[AI] Hook for returning object to default (empty) state; not implemented in this base.

[AI]

Returns
TRUE if state was reset, FALSE otherwise [AI]

Reimplemented in HelicopterState, Act1State, AnimState, and ScoreState.

Definition at line 131 of file legostate.h.

◆ Serialize()

virtual MxResult LegoState::Serialize ( LegoStorage p_storage)
inlinevirtual

[AI] Serialize state to a storage (for save/load).

[AI]

Parameters
p_storageStream/abstraction for state IO (see LegoStorage) [AI]
Returns
Serialization result (SUCCESS or error code) [AI]

[AI] In write mode, stores class name; designed for override in derived classes. [AI]

Reimplemented in AmbulanceMissionState, GasStationState, HospitalState, Act1State, AnimState, LegoVehicleBuildState, RaceState, PizzaMissionState, PizzeriaState, PoliceState, and TowTrackMissionState.

Definition at line 141 of file legostate.h.


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