Make ControlBehavior messages far more modular (#991)

* Make case consistent

* How modular can you go?

Holy modular

* Add comments

* Initialize values
This commit is contained in:
David Markowitz
2023-02-16 09:30:33 -08:00
committed by GitHub
parent 484488e47d
commit d138b7b878
38 changed files with 461 additions and 438 deletions

View File

@@ -1,20 +1,8 @@
#include "UpdateStripUiMessage.h"
UpdateStripUiMessage::UpdateStripUiMessage(AMFArrayValue* arguments) {
auto* uiArray = arguments->FindValue<AMFArrayValue>("ui");
if (!uiArray) return;
UpdateStripUiMessage::UpdateStripUiMessage(AMFArrayValue* arguments) : BehaviorMessageBase(arguments) {
position = StripUiPosition(arguments);
actionContext = ActionContext(arguments);
auto* xPositionValue = uiArray->FindValue<AMFDoubleValue>("x");
auto* yPositionValue = uiArray->FindValue<AMFDoubleValue>("y");
if (!xPositionValue || !yPositionValue) return;
yPosition = yPositionValue->GetDoubleValue();
xPosition = xPositionValue->GetDoubleValue();
stripID = GetStripIDFromArgument(arguments);
stateID = GetBehaviorStateFromArgument(arguments);
behaviorID = GetBehaviorIDFromArgument(arguments);
Game::logger->LogDebug("UpdateStripUIMessage", "x %f y %f stpId %i sttId %i bhId %i", xPosition, yPosition, stripID, stateID, behaviorID);
Game::logger->LogDebug("UpdateStripUIMessage", "xPosition %f yPosition %f stripId %i stateId %i behaviorId %i", position.GetX(), position.GetY(), actionContext.GetStripId(), actionContext.GetStateId(), behaviorId);
}