Isle
Loading...
Searching...
No Matches
LegoState::Playlist Struct Reference

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

#include <legostate.h>

Public Types

enum  Mode { e_loop , e_once , e_random , e_loopSkipFirst }
 [AI] Playback/select mode for playlist sequencing [AI] More...
 

Public Member Functions

 Playlist ()
 [AI] Initializes playlist with no object IDs and default mode (loop). More...
 
 Playlist (MxU32 *p_objectIds, MxS16 p_length, MxS16 p_mode)
 [AI] Initialize a Playlist using specific object IDs, length, and mode. More...
 
Playlistoperator= (const Playlist &p_playlist)
 [AI] Assignment operator to copy playlist state (pointers and counters only; does not deep-copy IDs array). More...
 
MxU32 Next ()
 [AI] Retrieves the object ID at the current position, advances next index according to playlist mode. More...
 
MxBool Contains (MxU32 p_objectId)
 [AI] Checks if playlist contains an object ID. More...
 

Public Attributes

MxU32m_objectIds
 [AI] Pointer to array of object IDs. Not owned; just used for lookup. [AI] More...
 
MxS16 m_length
 [AI] Number of IDs in the playlist. [AI] More...
 
MxS16 m_mode
 [AI] Selection/iteration mode (as in Mode). [AI] More...
 
MxS16 m_nextIndex
 [AI] Current index for next selection (suitable for sequential/random access). [AI] More...
 

Detailed Description

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

[AI]

This is used for e.g. playing sounds, animations or other events in sequence or randomly. [AI]

Definition at line 36 of file legostate.h.

Member Enumeration Documentation

◆ Mode

[AI] Playback/select mode for playlist sequencing [AI]

Enumerator
e_loop 

[AI] Continue repeating all items in sequence [AI]

e_once 

[AI] Play all items just one time [AI]

e_random 

[AI] Pick a random item each time [AI]

e_loopSkipFirst 

[AI] Repeats items in sequence, but skips first entry after the initial loop [AI]

Definition at line 40 of file legostate.h.

Constructor & Destructor Documentation

◆ Playlist() [1/2]

LegoState::Playlist::Playlist ( )
inline

[AI] Initializes playlist with no object IDs and default mode (loop).

[AI]

Definition at line 52 of file legostate.h.

◆ Playlist() [2/2]

LegoState::Playlist::Playlist ( MxU32 p_objectIds,
MxS16  p_length,
MxS16  p_mode 
)
inline

[AI] Initialize a Playlist using specific object IDs, length, and mode.

Parameters
p_objectIdsPointer to array of object IDs for playlist [AI]
p_lengthTotal number of object IDs [AI]
p_modePlaylist's sequencing mode, as per Mode enum [AI]

Definition at line 67 of file legostate.h.

Member Function Documentation

◆ Contains()

MxBool LegoState::Playlist::Contains ( MxU32  p_objectId)

[AI] Checks if playlist contains an object ID.

[AI]

Parameters
p_objectIdThe object ID to look for [AI]
Returns
TRUE if found, FALSE otherwise [AI]

[AI] Linear search through current range. [AI]

Definition at line 51 of file legostate.cpp.

◆ Next()

MxU32 LegoState::Playlist::Next ( )

[AI] Retrieves the object ID at the current position, advances next index according to playlist mode.

[AI]

Returns
Next object ID selected by the playlist strategy [AI]

[AI] e_loop: cycles round, e_once: stops incrementing, e_random: picks randomly, e_loopSkipFirst: starts from 1 after first loop. [AI]

Definition at line 10 of file legostate.cpp.

◆ operator=()

Playlist & LegoState::Playlist::operator= ( const Playlist p_playlist)
inline

[AI] Assignment operator to copy playlist state (pointers and counters only; does not deep-copy IDs array).

[AI]

Parameters
p_playlistSource playlist to copy from [AI]
Returns
Reference to this Playlist [AI]

[AI] Copies the pointer to object ID array, length, next index, and mode. [AI]

Definition at line 83 of file legostate.h.

Member Data Documentation

◆ m_length

MxS16 LegoState::Playlist::m_length

[AI] Number of IDs in the playlist. [AI]

Definition at line 108 of file legostate.h.

◆ m_mode

MxS16 LegoState::Playlist::m_mode

[AI] Selection/iteration mode (as in Mode). [AI]

Definition at line 109 of file legostate.h.

◆ m_nextIndex

MxS16 LegoState::Playlist::m_nextIndex

[AI] Current index for next selection (suitable for sequential/random access). [AI]

Definition at line 110 of file legostate.h.

◆ m_objectIds

MxU32* LegoState::Playlist::m_objectIds

[AI] Pointer to array of object IDs. Not owned; just used for lookup. [AI]

Definition at line 107 of file legostate.h.


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