#include "xfxelemvisualstate.h"

XFxElemVisualState::XFxElemVisualState()
    : XAsset()
    , mColor(Qt::black)
    , mRotationDelta(0)
    , mRotationTotal(0)
    , mSize(0, 0)
    , mScale(0)
{
    
}

XFxElemVisualState::~XFxElemVisualState()
{
    
}

void XFxElemVisualState::Clear()
{
    mColor = Qt::black;
    mRotationDelta = 0;
    mRotationTotal = 0;
    mSize = QSize(0, 0);
    mScale = 0;
}

void XFxElemVisualState::ParseData(QDataStream *aStream)
{
    quint8 r, g, b, a;
    *aStream
        >> r
        >> g
        >> b
        >> a;
    mColor = QColor(r, g, b, a);

    *aStream
        >> mRotationDelta
        >> mRotationTotal;

    float width, height;
    *aStream
        >> width
        >> height;
    mSize = QSize(width, height);

    *aStream >> mScale;
}
