DarkflameServer/dGame/dPropertyBehaviors/ControlBehaviorMessages/StripUiPosition.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
554 B
C++
Raw Normal View History

#include "StripUiPosition.h"
#include "Amf3.h"
StripUiPosition::StripUiPosition() {
xPosition = 0.0;
yPosition = 0.0;
}
StripUiPosition::StripUiPosition(AMFArrayValue* arguments, std::string uiKeyName) {
xPosition = 0.0;
yPosition = 0.0;
auto* uiArray = arguments->GetArray(uiKeyName);
if (!uiArray) return;
auto* xPositionValue = uiArray->Get<double>("x");
auto* yPositionValue = uiArray->Get<double>("y");
if (!xPositionValue || !yPositionValue) return;
yPosition = yPositionValue->GetValue();
xPosition = xPositionValue->GetValue();
}