squash commits (#1479)

This commit is contained in:
jadebenn
2024-02-27 01:29:51 -06:00
committed by GitHub
parent b261e63233
commit 424d54b98c
43 changed files with 132 additions and 130 deletions

View File

@@ -4,20 +4,20 @@
#include "Amf3.h"
ActionContext::ActionContext(const AMFArrayValue* arguments, const std::string& customStateKey, const std::string& customStripKey)
ActionContext::ActionContext(const AMFArrayValue& arguments, const std::string& customStateKey, const std::string& customStripKey)
: m_StripId{ GetStripIdFromArgument(arguments, customStripKey) }
, m_StateId{ GetBehaviorStateFromArgument(arguments, customStateKey) } {
}
BehaviorState ActionContext::GetBehaviorStateFromArgument(const AMFArrayValue* arguments, const std::string& key) const {
const auto* const stateIDValue = arguments->Get<double>(key);
BehaviorState ActionContext::GetBehaviorStateFromArgument(const AMFArrayValue& arguments, const std::string& key) const {
const auto* const stateIDValue = arguments.Get<double>(key);
if (!stateIDValue) throw std::invalid_argument("Unable to find behavior state from argument \"" + key + "\"");
return static_cast<BehaviorState>(stateIDValue->GetValue());
}
StripId ActionContext::GetStripIdFromArgument(const AMFArrayValue* arguments, const std::string& key) const {
const auto* const stripIdValue = arguments->Get<double>(key);
StripId ActionContext::GetStripIdFromArgument(const AMFArrayValue& arguments, const std::string& key) const {
const auto* const stripIdValue = arguments.Get<double>(key);
if (!stripIdValue) throw std::invalid_argument("Unable to find strip ID from argument \"" + key + "\"");
return static_cast<StripId>(stripIdValue->GetValue());