isle/LEGO1/mxdsserialaction.cpp

81 lines
1.6 KiB
C++
Raw Normal View History

#include "mxdsserialaction.h"
2023-10-24 19:38:27 -04:00
#include "mxdsmediaaction.h"
DECOMP_SIZE_ASSERT(MxDSSerialAction, 0xa8)
// OFFSET: LEGO1 0x100ca9d0
MxDSSerialAction::MxDSSerialAction()
{
2023-10-24 19:38:27 -04:00
this->SetType(MxDSType_SerialAction);
this->m_cursor = new MxDSActionListCursor(this->m_actions);
this->m_unk0xa0 = 0;
}
// OFFSET: LEGO1 0x100caac0
void MxDSSerialAction::SetDuration(MxLong p_duration)
{
2023-10-24 19:38:27 -04:00
this->m_duration = p_duration;
}
// OFFSET: LEGO1 0x100cac10
MxDSSerialAction::~MxDSSerialAction()
{
2023-10-24 19:38:27 -04:00
if (this->m_cursor)
delete this->m_cursor;
2023-10-24 19:38:27 -04:00
this->m_cursor = NULL;
}
// OFFSET: LEGO1 0x100cac90
2023-10-24 19:38:27 -04:00
void MxDSSerialAction::CopyFrom(MxDSSerialAction& p_dsSerialAction)
{
}
// OFFSET: LEGO1 0x100caca0
2023-10-24 19:38:27 -04:00
MxDSSerialAction& MxDSSerialAction::operator=(MxDSSerialAction& p_dsSerialAction)
{
2023-10-24 19:38:27 -04:00
if (this == &p_dsSerialAction)
return *this;
2023-10-24 19:38:27 -04:00
MxDSMultiAction::operator=(p_dsSerialAction);
this->CopyFrom(p_dsSerialAction);
return *this;
}
// OFFSET: LEGO1 0x100cacd0
2023-10-24 19:38:27 -04:00
MxDSAction* MxDSSerialAction::Clone()
{
2023-10-24 19:38:27 -04:00
MxDSSerialAction* clone = new MxDSSerialAction();
2023-10-24 19:38:27 -04:00
if (clone)
*clone = *this;
2023-10-24 19:38:27 -04:00
return clone;
}
// OFFSET: LEGO1 0x100cad60
MxLong MxDSSerialAction::GetDuration()
{
2023-10-24 19:38:27 -04:00
if (this->m_duration)
return this->m_duration;
2023-10-24 19:38:27 -04:00
MxDSActionListCursor cursor(this->m_actions);
MxDSAction* action;
2023-10-24 19:38:27 -04:00
while (cursor.Next(action)) {
if (!action)
continue;
2023-10-24 19:38:27 -04:00
this->m_duration += action->GetDuration() + action->GetStartTime();
2023-10-24 19:38:27 -04:00
if (action->IsA("MxDSMediaAction")) {
MxLong sustainTime = ((MxDSMediaAction*) action)->GetSustainTime();
2023-10-24 19:38:27 -04:00
if (sustainTime && sustainTime != -1)
this->m_duration += sustainTime;
}
}
2023-10-24 19:38:27 -04:00
return this->m_duration;
}