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

[AI] Represents a trigger/control element in the LEGO world's path system, linked logically to the world and supporting complex event logic via triggers. More...

#include <legopathstruct.h>

Inheritance diagram for LegoPathStruct:
Collaboration diagram for LegoPathStruct:

Public Types

enum  Trigger {
  c_camAnim = 'C' , c_d = 'D' , c_e = 'E' , c_g = 'G' ,
  c_h = 'H' , c_music = 'M' , c_s = 'S' , c_w = 'W'
}
 [AI] Enumerated list of recognized path trigger types. More...
 
- Public Types inherited from LegoPathStructBase
enum  {
  c_bit1 = 0x01 << 24 , c_bit2 = 0x02 << 24 , c_bit3 = 0x04 << 24 , c_bit4 = 0x08 << 24 ,
  c_bit5 = 0x10 << 24 , c_bit6 = 0x20 << 24 , c_bit7 = 0x40 << 24
}
 [AI] Bitmask constants for path struct matching and triggering logic. More...
 

Public Member Functions

 LegoPathStruct ()
 [AI] Default constructor; sets world pointer to NULL. More...
 
 ~LegoPathStruct () override
 [AI] Destructor. More...
 
virtual void HandleTrigger (LegoPathActor *p_actor, MxBool p_direction, MxU32 p_data)
 [AI] Main trigger handler; evaluates flags and name-based script to decide what action to take when an actor enters the struct. More...
 
void SetWorld (LegoWorld *p_world)
 [AI] Binds a world instance to this path struct for context-specific handling. More...
 
void SetAtomId (const MxAtomId &p_atomId)
 [AI] Sets this struct's AtomId for data/action lookup and dispatch. More...
 
- Public Member Functions inherited from LegoPathStructBase
 LegoPathStructBase ()
 [AI] Default constructor. Initializes name pointer to NULL and flags to 0. More...
 
virtual ~LegoPathStructBase ()
 [AI] Virtual destructor. Frees the name buffer if allocated. More...
 

Additional Inherited Members

- Public Attributes inherited from LegoPathStructBase
char * m_name
 [AI] Dynamically allocated name for this path struct instance (e.g., a label or trigger identifier). More...
 
MxU32 m_flags
 [AI] Bitfield of state and trigger flags for fast matching in trigger logic. More...
 

Detailed Description

[AI] Represents a trigger/control element in the LEGO world's path system, linked logically to the world and supporting complex event logic via triggers.

[AI] Each path struct can respond to triggers via HandleTrigger, linking actors, the world, notifications, and actions such as animations or music.

Remarks
[AI] Used extensively to define world transitions, script triggers, and area-based world changes.

Definition at line 98 of file legopathstruct.h.

Member Enumeration Documentation

◆ Trigger

[AI] Enumerated list of recognized path trigger types.

[AI] These map to characters in 'm_name[2]' representing script/trigger actions handled in HandleTrigger().

Enumerator
c_camAnim 

[AI] Camera animation trigger.

c_d 

[AI] Door or passage transition trigger.

c_e 

[AI] Event trigger.

c_g 

[AI] Generic placeholder trigger.

c_h 

[AI] Hide animation trigger.

c_music 

[AI] Music control trigger.

c_s 

[AI] State change trigger.

c_w 

[AI] World notification trigger.

Definition at line 102 of file legopathstruct.h.

Constructor & Destructor Documentation

◆ LegoPathStruct()

LegoPathStruct::LegoPathStruct ( )
inline

[AI] Default constructor; sets world pointer to NULL.

Definition at line 115 of file legopathstruct.h.

◆ ~LegoPathStruct()

LegoPathStruct::~LegoPathStruct ( )
inlineoverride

[AI] Destructor.

Definition at line 119 of file legopathstruct.h.

Member Function Documentation

◆ HandleTrigger()

void LegoPathStruct::HandleTrigger ( LegoPathActor p_actor,
MxBool  p_direction,
MxU32  p_data 
)
virtual

[AI] Main trigger handler; evaluates flags and name-based script to decide what action to take when an actor enters the struct.

[AI] Attempts handling in the default direction (p_bool = FALSE), but if no match and re-evaluation flag is set, will call again with opposite branch (p_bool = TRUE).

Parameters
p_actor[AI] The actor entering or interacting with the path struct.
p_direction[AI] Direction flag relevant to the event context.
p_data[AI] Supplemental data from the event (context-dependent: animation id, script id, etc).

Definition at line 26 of file legopathstruct.cpp.

◆ SetAtomId()

void LegoPathStruct::SetAtomId ( const MxAtomId p_atomId)
inline

[AI] Sets this struct's AtomId for data/action lookup and dispatch.

Parameters
p_atomId[AI] AtomId of the associated SI/script/asset.

Definition at line 134 of file legopathstruct.h.

◆ SetWorld()

void LegoPathStruct::SetWorld ( LegoWorld p_world)
inline

[AI] Binds a world instance to this path struct for context-specific handling.

Parameters
p_world[AI] Pointer to the LegoWorld using this struct.

Definition at line 130 of file legopathstruct.h.


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