2023-02-14 02:55:44 +00:00
|
|
|
#include "AddStripMessage.h"
|
|
|
|
|
2023-02-16 17:30:33 +00:00
|
|
|
#include "Action.h"
|
|
|
|
|
2024-02-18 06:38:26 +00:00
|
|
|
AddStripMessage::AddStripMessage(const AMFArrayValue* arguments)
|
|
|
|
: BehaviorMessageBase{ arguments }
|
|
|
|
, m_Position{ arguments }
|
|
|
|
, m_ActionContext{ arguments } {
|
2023-02-16 17:30:33 +00:00
|
|
|
|
2024-02-18 06:38:26 +00:00
|
|
|
const auto* const strip = arguments->GetArray("strip");
|
2023-02-14 02:55:44 +00:00
|
|
|
if (!strip) return;
|
|
|
|
|
2024-02-18 06:38:26 +00:00
|
|
|
const auto* const actions = strip->GetArray("actions");
|
2023-02-14 02:55:44 +00:00
|
|
|
if (!actions) return;
|
|
|
|
|
2023-05-13 22:22:00 +00:00
|
|
|
for (uint32_t actionNumber = 0; actionNumber < actions->GetDense().size(); actionNumber++) {
|
2024-02-18 06:38:26 +00:00
|
|
|
const auto* const actionValue = actions->GetArray(actionNumber);
|
2023-02-16 17:30:33 +00:00
|
|
|
if (!actionValue) continue;
|
2023-02-14 02:55:44 +00:00
|
|
|
|
2024-02-18 06:38:26 +00:00
|
|
|
m_ActionsToAdd.emplace_back(actionValue);
|
2023-02-14 02:55:44 +00:00
|
|
|
|
2024-02-18 06:38:26 +00:00
|
|
|
LOG_DEBUG("xPosition %f yPosition %f stripId %i stateId %i behaviorId %i t %s valueParameterName %s valueParameterString %s valueParameterDouble %f", m_Position.GetX(), m_Position.GetY(), m_ActionContext.GetStripId(), m_ActionContext.GetStateId(), m_BehaviorId, m_ActionsToAdd.back().GetType().c_str(), m_ActionsToAdd.back().GetValueParameterName().c_str(), m_ActionsToAdd.back().GetValueParameterString().c_str(), m_ActionsToAdd.back().GetValueParameterDouble());
|
2023-02-14 02:55:44 +00:00
|
|
|
}
|
2024-02-18 06:38:26 +00:00
|
|
|
LOG_DEBUG("number of actions %i", m_ActionsToAdd.size());
|
2024-01-30 03:45:50 +00:00
|
|
|
}
|