Isle
Loading...
Searching...
No Matches
mxdsserialaction.cpp
Go to the documentation of this file.
1#include "mxdsserialaction.h"
2
3#include "mxdebug.h"
4#include "mxdsmediaaction.h"
5
7
8// FUNCTION: LEGO1 0x100ca9d0
9// FUNCTION: BETA10 0x10159cf3
11{
12 m_type = e_serialAction;
13 m_cursor = new MxDSActionListCursor(m_actionList);
14 m_unk0xa0 = 0;
15}
16
17// FUNCTION: LEGO1 0x100caac0
18// FUNCTION: BETA10 0x1015b280
20{
21 m_duration = p_duration;
22}
23
24// FUNCTION: LEGO1 0x100cac10
25// FUNCTION: BETA10 0x10159dd1
27{
28 delete m_cursor;
29 m_cursor = NULL;
30}
31
32// FUNCTION: LEGO1 0x100cac90
33// FUNCTION: BETA10 0x10159e73
35{
36 if (p_dsSerialAction.m_cursor->HasMatch() || p_dsSerialAction.m_unk0xa0) {
37 MxTrace("copying a serialAction while someone is traversing it's list\n");
38 }
39}
40
41// FUNCTION: BETA10 0x10159ec2
43{
44 CopyFrom(p_dsSerialAction);
45}
46
47// FUNCTION: LEGO1 0x100caca0
48// FUNCTION: BETA10 0x10159f43
50{
51 if (this == &p_dsSerialAction) {
52 return *this;
53 }
54
55 MxDSMultiAction::operator=(p_dsSerialAction);
56 CopyFrom(p_dsSerialAction);
57 return *this;
58}
59
60// FUNCTION: LEGO1 0x100cacd0
61// FUNCTION: BETA10 0x10159f8a
63{
65
66 if (clone) {
67 *clone = *this;
68 }
69
70 return clone;
71}
72
73// FUNCTION: LEGO1 0x100cad60
74// FUNCTION: BETA10 0x1015a034
76{
77 if (m_duration) {
78 return m_duration;
79 }
80
82 MxDSAction* action;
83
84 while (cursor.Next(action)) {
85 if (action) {
86 m_duration += action->GetDuration() + action->GetStartTime();
87
88 if (action->IsA("MxDSMediaAction")) {
89 MxLong sustainTime = ((MxDSMediaAction*) action)->GetSustainTime();
90
91 if (sustainTime && sustainTime != -1) {
92 m_duration += sustainTime;
93 }
94 }
95 }
96 }
97
98 return m_duration;
99}
[AI] Convenience cursor class for iterating over an MxDSActionList.
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
Definition: mxdsaction.h:17
MxLong GetStartTime() const
[AI] Gets the nominal start time for the action, as loaded or scheduled.
Definition: mxdsaction.h:198
MxBool IsA(const char *p_name) const override
[AI] Run-time type check, compares provided name with this or any ancestor type.
Definition: mxdsaction.h:80
virtual MxLong GetDuration()
[AI] Gets the duration for which this action is intended to run.
Definition: mxdsaction.cpp:39
MxLong m_duration
[AI] The duration to run the action, or INT_MIN for undefined.
Definition: mxdsaction.h:300
MxDSMediaAction extends MxDSAction to add media-specific playback properties and management.
[AI] Represents a container for multiple MxDSAction objects, facilitating the grouping and management...
MxDSActionList * m_actionList
[AI] List of contained actions (ownership: this owns and deletes subactions).
MxDSMultiAction & operator=(MxDSMultiAction &p_dsMultiAction)
[AI] Assignment operator, deeply copies all state and actions from another MxDSMultiAction.
[AI] Represents a serial (sequential) action group for data-driven sequence execution in LEGO Island.
MxDSSerialAction & operator=(MxDSSerialAction &p_dsSerialAction)
[AI] Assignment operator.
MxLong GetDuration() override
[AI] Calculates and retrieves the total duration of this serial action.
MxDSAction * Clone() override
[AI] Clones (deep copies) this serial action, including its list of contained actions and configurati...
MxDSSerialAction()
[AI] Constructs an empty serial action, setting up the cursor and type.
void CopyFrom(MxDSSerialAction &p_dsSerialAction)
[AI] Copies the state of another MxDSSerialAction into this one, including duplication warnings if th...
~MxDSSerialAction() override
[AI] Destructor.
void SetDuration(MxLong p_duration) override
[AI] Sets an explicit duration value for the entire serial action sequence.
MxBool Next()
[AI]
MxBool HasMatch()
[AI]
Definition: mxlist.h:242
#define DECOMP_SIZE_ASSERT(T, S)
Definition: decomp.h:19
#define NULL
[AI] Null pointer value (C/C++ semantics).
Definition: legotypes.h:26
#define MxTrace(args)
[AI] Macro for trace logging (non-variadic version, MSVC compatibility), expands to nothing.
Definition: mxdebug.h:55
int MxLong
[AI]
Definition: mxtypes.h:83