mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-26 15:33:34 +00:00
b6af92ef81
* Split out BehaviorMessage class changes from PR #1452 * remove <string_view> inclusion in ActionContext.h * add the arguments nullptr check back in * remove redundant std::string constructor calls * Update AddStripMessage.cpp - change push_back to emplace_back
26 lines
1.1 KiB
C++
26 lines
1.1 KiB
C++
#include "AddStripMessage.h"
|
|
|
|
#include "Action.h"
|
|
|
|
AddStripMessage::AddStripMessage(const AMFArrayValue* arguments)
|
|
: BehaviorMessageBase{ arguments }
|
|
, m_Position{ arguments }
|
|
, m_ActionContext{ arguments } {
|
|
|
|
const auto* const strip = arguments->GetArray("strip");
|
|
if (!strip) return;
|
|
|
|
const auto* const actions = strip->GetArray("actions");
|
|
if (!actions) return;
|
|
|
|
for (uint32_t actionNumber = 0; actionNumber < actions->GetDense().size(); actionNumber++) {
|
|
const auto* const actionValue = actions->GetArray(actionNumber);
|
|
if (!actionValue) continue;
|
|
|
|
m_ActionsToAdd.emplace_back(actionValue);
|
|
|
|
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());
|
|
}
|
|
LOG_DEBUG("number of actions %i", m_ActionsToAdd.size());
|
|
}
|