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

[AI] Handles and stores state for the in-game radio, including track playlists, cycling, and active status. More...

#include <radio.h>

Inheritance diagram for RadioState:
Collaboration diagram for RadioState:

Public Member Functions

 RadioState ()
 [AI] Constructs a new RadioState, randomizing playlist indices and initial state. More...
 
MxBool IsSerializable () override
 [AI] Radio state is not serializable, i.e., not written to save files. More...
 
const char * ClassName () const override
 [AI] Returns the runtime class name for RadioState. More...
 
MxBool IsA (const char *p_name) const override
 [AI] Checks if the given type name matches this class or any parent class. More...
 
MxBool IsActive ()
 [AI] Indicates whether the radio is currently playing. More...
 
void SetActive (MxBool p_active)
 [AI] Sets active status of the radio. More...
 
undefined4 FUN_1002d090 ()
 [AI] Cycles to the next playlist and returns the next object ID to play. More...
 
MxBool FUN_1002d0c0 (const MxAtomId &p_atom, MxU32 p_objectId)
 [AI] Checks if the given atom/object ID matches one of the radio's playlists. 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

Playlist m_unk0x08 [3]
 [AI] Radio playlists. Each is a collection of track IDs used by the radio (effects, dialogue, music). More...
 
MxS16 m_unk0x2c
 [AI] Index for cycling among the three playlists (0-2). More...
 
MxBool m_active
 [AI] If TRUE, the radio is playing; FALSE otherwise. 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] Handles and stores state for the in-game radio, including track playlists, cycling, and active status.

[AI] Three playlists are used: one for sound effects, one for dialogue, and one for radio music. The state also tracks the currently playing playlist and handles serializability and RTTI. []

Definition at line 18 of file radio.h.

Constructor & Destructor Documentation

◆ RadioState()

RadioState::RadioState ( )

[AI] Constructs a new RadioState, randomizing playlist indices and initial state.

Definition at line 214 of file radio.cpp.

Member Function Documentation

◆ ClassName()

const char * RadioState::ClassName ( ) const
inlineoverridevirtual

[AI] Returns the runtime class name for RadioState.

Reimplemented from LegoState.

Definition at line 28 of file radio.h.

◆ FUN_1002d090()

MxU32 RadioState::FUN_1002d090 ( )

[AI] Cycles to the next playlist and returns the next object ID to play.

Returns
MxU32 representing the next audio object to play [AI]

Definition at line 234 of file radio.cpp.

◆ FUN_1002d0c0()

MxBool RadioState::FUN_1002d0c0 ( const MxAtomId p_atom,
MxU32  p_objectId 
)

[AI] Checks if the given atom/object ID matches one of the radio's playlists.

Parameters
p_atomAtom ID (script/audio identifier) [AI]
p_objectIdAudio object ID to check [AI]
Returns
TRUE if the object ID is in any playlist, FALSE otherwise [AI]

Definition at line 247 of file radio.cpp.

◆ IsA()

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

[AI] Checks if the given type name matches this class or any parent class.

Parameters
p_nameClass name to check against [AI]

[AI] Compares against RadioState's name or falls back on LegoState::IsA

Reimplemented from LegoState.

Definition at line 37 of file radio.h.

◆ IsActive()

MxBool RadioState::IsActive ( )
inline

[AI] Indicates whether the radio is currently playing.

Definition at line 46 of file radio.h.

◆ IsSerializable()

MxBool RadioState::IsSerializable ( )
inlineoverridevirtual

[AI] Radio state is not serializable, i.e., not written to save files.

Returns
Always FALSE [AI]

Reimplemented from LegoState.

Definition at line 25 of file radio.h.

◆ SetActive()

void RadioState::SetActive ( MxBool  p_active)
inline

[AI] Sets active status of the radio.

Parameters
p_activeNew active state (TRUE = playing) [AI]

Definition at line 50 of file radio.h.

Member Data Documentation

◆ m_active

MxBool RadioState::m_active

[AI] If TRUE, the radio is playing; FALSE otherwise.

Definition at line 67 of file radio.h.

◆ m_unk0x08

Playlist RadioState::m_unk0x08[3]

[AI] Radio playlists. Each is a collection of track IDs used by the radio (effects, dialogue, music).

Definition at line 63 of file radio.h.

◆ m_unk0x2c

MxS16 RadioState::m_unk0x2c

[AI] Index for cycling among the three playlists (0-2).

Definition at line 65 of file radio.h.


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