Isle
Loading...
Searching...
No Matches
legoplantmanager.h
Go to the documentation of this file.
1#ifndef LEGOPLANTMANAGER_H
2#define LEGOPLANTMANAGER_H
3
4#include "decomp.h"
5#include "legomain.h"
6#include "mxcore.h"
7
8class LegoEntity;
10struct LegoPlantInfo;
11class LegoROI;
12class LegoStorage;
13class LegoWorld;
14
15// VTABLE: LEGO1 0x100d6758
16// SIZE 0x2c
30class LegoPlantManager : public MxCore {
31public:
40 struct AnimEntry {
44 };
45
50
54 ~LegoPlantManager() override; // vtable+0x00
55
64 MxResult Tickle() override; // vtable+0x08
65
69 const char* ClassName() const override // vtable+0x0c
70 {
71 // While this class exists in BETA10, it didn't have a ClassName().
72 // I suppose it did not inherit from MxCore back then and likely did not have a VTABLE.
73 // STRING: LEGO1 0x100f318c
74 return "LegoPlantManager";
75 }
76
82 void Init();
83
91 void LoadWorldInfo(LegoOmni::World p_worldId);
92
100 void Reset(LegoOmni::World p_worldId);
101
108 MxResult Write(LegoStorage* p_storage);
109
116 MxResult Read(LegoStorage* p_storage);
117
122
130 MxBool SwitchColor(LegoEntity* p_entity);
131
139
145 MxBool SwitchSound(LegoEntity* p_entity);
146
152 MxBool SwitchMove(LegoEntity* p_entity);
153
159 MxBool SwitchMood(LegoEntity* p_entity);
160
166
173 MxU32 GetSoundId(LegoEntity* p_entity, MxBool p_state);
174
180 LegoPlantInfo* GetInfoArray(MxS32& p_length);
181
189 LegoEntity* CreatePlant(MxS32 p_index, LegoWorld* p_world, LegoOmni::World p_worldId);
190
197 MxBool FUN_10026c50(LegoEntity* p_entity);
198
205 void ScheduleAnimation(LegoEntity* p_entity, MxLong p_length);
206
212
217 void FUN_10027120();
218
223 void FUN_10027200();
224
231 static void SetCustomizeAnimFile(const char* p_value);
232
237 static const char* GetCustomizeAnimFile() { return g_customizeAnimFile; }
238
239 // SYNTHETIC: LEGO1 0x100262a0
240 // LegoPlantManager::`scalar deleting destructor'
241
242private:
250 void RemovePlant(MxS32 p_index, LegoOmni::World p_worldId);
251
257 void FUN_10026860(MxS32 p_index);
258
265 LegoPlantInfo* GetInfo(LegoEntity* p_entity);
266
272 MxBool FUN_10026c80(MxS32 p_index);
273
280 void FUN_100271b0(LegoEntity* p_entity, MxS32 p_adjust);
281
282 static char* g_customizeAnimFile;
283 static MxS32 g_maxMove[4];
284 static MxU32 g_maxSound;
285
286 LegoOmni::World m_worldId;
287 undefined m_unk0x0c;
288 AnimEntry* m_entries[5];
289 MxS8 m_numEntries;
290 LegoWorld* m_world;
291};
292
293#endif // LEGOPLANTMANAGER_H
[AI] Represents an entity that can be placed and managed in the LEGO Island world.
Definition: legoentity.h:16
World
[AI] Identifiers for all unique, script-driven world environments in LEGO Island.
Definition: legomain.h:57
[AI] Represents a path segment or boundary in the navigation network for actors (vehicles,...
[AI] Manages the lifecycle, state, and properties for all plant objects (flowers, trees,...
void ScheduleAnimation(LegoEntity *p_entity, MxLong p_length)
[AI] Schedules an animation for the given plant, adding an entry to the internal tickle array.
~LegoPlantManager() override
[AI] Destructor.
MxBool SwitchSound(LegoEntity *p_entity)
[AI] Cycles the sound effect variant for a plant.
LegoEntity * CreatePlant(MxS32 p_index, LegoWorld *p_world, LegoOmni::World p_worldId)
[AI] Instantiates an entity and ROI for the plant at given index in world (if appropriate).
MxResult Read(LegoStorage *p_storage)
[AI] Rehydrates plant state from storage, restoring color/variant/mood/move properties.
static const char * GetCustomizeAnimFile()
[AI] Gets the current file name/path for plant customization animation file.
void FUN_10027120()
[AI] Resets all growth/activity/animation state for all plants in the manager.
MxResult Write(LegoStorage *p_storage)
[AI] Serializes persistent plant state (color, variant, mood, animation, etc) to storage for save gam...
MxBool SwitchColor(LegoEntity *p_entity)
[AI] Cycles the color attribute for the plant and updates its LOD/appearance.
MxResult FUN_10026410()
[AI] Repairs/updates all plant boundary references and vertical position to match world boundaries/pl...
MxResult Tickle() override
[AI] Tickle handler for processing scheduled plant animation entries.
MxBool SwitchVariant(LegoEntity *p_entity)
[AI] Cycles the variant/type for a plant (flower, tree, bush, palm) and updates appearance.
MxU32 GetSoundId(LegoEntity *p_entity, MxBool p_state)
[AI] Returns the sound ID for a plant, used for localized SFX depending on mood/state.
void LoadWorldInfo(LegoOmni::World p_worldId)
[AI] Loads all plant objects/entities for the requested world, instantiates requisite ROIs and entiti...
MxBool FUN_10026c50(LegoEntity *p_entity)
[AI] Triggers a growth decrement or similar on a plant entity, and updates accordingly if possible.
LegoPlantManager()
[AI] Constructs the plant manager and initializes its bookkeeping to match the plant info array.
LegoPlantInfo * GetInfoArray(MxS32 &p_length)
[AI] Returns pointer to plant info array and populates its size.
void Init()
[AI] Zeroes out state, resets world ID, and copies default plant info to runtime plant info array.
MxBool SwitchMood(LegoEntity *p_entity)
[AI] Cycles the plant's "mood" state property (e.g., for appearance/hidden states) [AI]
void FUN_10027200()
[AI] Propagates all plants' current growth/activity state to their restore points.
MxS32 GetNumPlants()
[AI] Returns the total number of plant records referenced by this manager.
const char * ClassName() const override
[AI] Returns the class name "LegoPlantManager".
void Reset(LegoOmni::World p_worldId)
[AI] Completely resets (removes) all plant objects for the supplied world.
MxU32 GetAnimationId(LegoEntity *p_entity)
[AI] Returns the current animation ID for the given plant, based on its variant and move type.
static void SetCustomizeAnimFile(const char *p_value)
[AI] Sets the global file path or name to use for plant customization animations.
MxBool SwitchMove(LegoEntity *p_entity)
[AI] Cycles the movement/animation type for a plant.
[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality.
Definition: legoroi.h:43
Abstract base class providing an interface for file-like storage with binary and text read/write oper...
Definition: legostorage.h:16
Represents the active 3D world, holding all entity, animation, sound, path, and ROI objects.
Definition: legoworld.h:49
[AI] Base virtual class for all Mindscape engine (Mx) objects.
Definition: mxcore.h:15
#define override
Definition: compat.h:21
unsigned char undefined
Definition: decomp.h:26
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
int MxLong
[AI]
Definition: mxtypes.h:83
signed int MxS32
[AI]
Definition: mxtypes.h:38
unsigned int MxU32
[AI]
Definition: mxtypes.h:32
signed char MxS8
[AI]
Definition: mxtypes.h:14
[AI] Struct representing a single plant's static configuration on LEGO Island, including placement,...
Definition: legoplants.h:18
[AI] Structure for scheduling plant ROI/entity animations (i.e.
MxLong m_time
[AI] When the animation should end (absolute time) [AI]
LegoROI * m_roi
[AI] ROI of the animated plant entity [AI]
LegoEntity * m_entity
[AI] Pointer to the plant entity being animated [AI]