1#ifndef LEGOCHARACTERMANAGER_H
2#define LEGOCHARACTERMANAGER_H
15#pragma warning(disable : 4237)
31 MxBool operator()(
const char*
const& p_a,
const char*
const& p_b)
const {
return strcmpi(p_a, p_b) < 0; }
115 void SetValue(
const char* p_value)
override;
362 LegoROI* CreateActorROI(
const char* p_key);
368 void RemoveROI(
LegoROI* p_roi);
378 static char* g_customizeAnimFile;
379 static MxU32 g_maxMove;
380 static MxU32 g_maxSound;
[AI] MxVariable subclass used to represent and propagate changes to the character customization anima...
void SetValue(const char *p_value) override
[AI] Sets the variable value and propagates customization file changes to relevant managers.
[AI] Represents an actor (character) entity in the LEGO Island 3D world, providing specific actor log...
[AI] Manages reference-counted characters and provides character creation, switching,...
MxBool SwitchMood(LegoROI *p_roi)
[AI] Cycles the mood type for the actor, updating the per-actor info.
LegoCharacterManager()
[AI] Constructs the character manager, initializing tables and the customizable animation variable.
LegoActorInfo * GetActorInfo(const char *p_name)
[AI] Returns the actor info struct for the character of the given name, or NULL if not found.
MxResult Write(LegoStorage *p_storage)
[AI] Writes the persistent character info data to a storage object.
void ReleaseAllActors()
[AI] Releases all actors associated with this manager, unregistering/releasing references until destr...
MxU32 GetNumActors()
[AI] Returns the number of actors registered in global g_actorInfo.
void Init()
[AI] Initializes all actor info structures based on their templates/defaults.
LegoExtraActor * GetExtraActor(const char *p_name)
[AI] Returns an extra actor associated with a given character name, or NULL if not found.
MxU32 GetSoundId(LegoROI *p_roi, MxBool p_und)
[AI] Returns the sound ID for the ROI's current sound/mood selection.
MxResult Read(LegoStorage *p_storage)
[AI] Reads character info data from a storage object.
LegoROI * CreateAutoROI(const char *p_name, const char *p_lodName, MxBool p_createEntity)
[AI] Creates an "auto" ROI object with the given name, LOD name, and optional entity creation.
static void SetCustomizeAnimFile(const char *p_value)
[AI] Sets the value of the customization animation file variable, propagating to all relevant subsyst...
MxU8 GetMood(LegoROI *p_roi)
[AI] Returns the current mood value (0-3) for the actor associated with the ROI.
MxResult FUN_10085870(LegoROI *p_roi)
[AI] Initializes auto-ROI with bounding volume and transformation.
MxU32 GetRefCount(LegoROI *p_roi)
[AI] Returns the reference count for a given LegoROI* tracked by the manager.
static MxBool IsActor(const char *p_name)
[AI] Checks if the given name matches an actor in the global actor table (case-insensitive).
~LegoCharacterManager()
[AI] Destroys the manager, cleaning up all managed characters and animation customization state.
static const char * GetCustomizeAnimFile()
[AI] Gets the value of the customize animation file variable.
void ReleaseActor(const char *p_name)
[AI] Releases a character/ROI by name, decrementing its reference count and deleting if zero.
LegoROI * GetActorROI(const char *p_name, MxBool p_createEntity)
[AI] Returns a LegoROI for the given character name, creating and registering the actor if necessary.
MxBool SwitchColor(LegoROI *p_roi, LegoROI *p_targetROI)
[AI] Changes the color of a part of a character's ROI, updating its part info index and updating ROI ...
MxBool SwitchSound(LegoROI *p_roi)
[AI] Cycles the sound type for the actor, updating the per-actor info.
MxBool FUN_100849a0(LegoROI *p_roi, LegoTextureInfo *p_texture)
[AI] Replaces the head LOD of a character ROI with a new LOD list built using the provided texture.
MxBool SwitchVariant(LegoROI *p_roi)
[AI] Cycles through part variants (e.g.
void ReleaseAutoROI(LegoROI *p_roi)
[AI] Releases an "auto" ROI, used for dynamically created ROI objects by this manager.
MxBool Exists(const char *p_name)
[AI] Returns whether a character with the given name exists in the manager.
LegoROI * FUN_10085a80(const char *p_name, const char *p_lodName, MxBool p_createEntity)
[AI] Helper function that delegates to CreateAutoROI.
MxBool SwitchMove(LegoROI *p_roi)
[AI] Cycles the move type for the actor, updating the per-actor info.
const char * GetActorName(MxS32 p_index)
[AI] Returns the actor name for the given actor index (lookup in global g_actorInfo table).
MxU32 GetAnimationId(LegoROI *p_roi)
[AI] Returns an animation ID corresponding to the ROI's move index.
[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality.
Abstract base class providing an interface for file-like storage with binary and text read/write oper...
[AI] Contains DirectDraw and Direct3DRM handles and metadata for a texture used in the LEGO Island re...
[AI] Represents a key-value variable as used in the variable table for the LEGO Island engine.
map< char *, LegoCharacter *, LegoCharacterComparator > LegoCharacterMap
[AI] Map from character name strings to LegoCharacter pointers.
[AI] STL compatibility layer header to provide consistent STL (Standard Template Library) types and a...
[AI] Contains information about a single LEGO actor/character, including its name,...
[AI] Comparator for character names, performing case-insensitive comparison using strcmpi.
MxBool operator()(const char *const &p_a, const char *const &p_b) const
[AI] Function call operator to compare two character name strings case-insensitively.
[AI] Holds a LegoROI pointer and reference count for a character instance managed by LegoCharacterMan...
LegoROI * m_roi
[AI] Pointer to the character's ROI object.
LegoCharacter(LegoROI *p_roi)
[AI] Constructs a LegoCharacter with an initial reference count of 1 and assigns the ROI pointer.
~LegoCharacter()
[AI] Destructor that deletes the associated ROI.
MxU32 m_refCount
[AI] Reference count tracking how many owners the character ROI has.
void AddRef()
[AI] Increments the internal reference count for this character.
MxU32 RemoveRef()
[AI] Decrements the internal reference count.