#ifndef XANIMPARTS_H
#define XANIMPARTS_H

#include "xasset.h"
#include <QString>
#include "xanimindices.h"
#include "xanimnotifyinfo.h"
#include "xanimdeltapart.h"

class XAnimParts : public XAsset
{
public:
    explicit XAnimParts();

    void ParseData(QDataStream *aStream) override;

    const QString& GetName() const;
    void SetName(const QString& name);

    quint32 GetNamePtr() const;
    void SetNamePtr(quint32 ptr);

    quint16 GetDataByteCount() const;
    void SetDataByteCount(quint16 count);

    quint16 GetDataShortCount() const;
    void SetDataShortCount(quint16 count);

    quint16 GetDataIntCount() const;
    void SetDataIntCount(quint16 count);

    quint16 GetRandomDataByteCount() const;
    void SetRandomDataByteCount(quint16 count);

    quint16 GetRandomDataIntCount() const;
    void SetRandomDataIntCount(quint16 count);

    quint16 GetNumFrames() const;
    void SetNumFrames(quint16 frames);

    bool IsLoop() const;
    void SetIsLoop(bool loop);

    bool IsDelta() const;
    void SetIsDelta(bool delta);

    const quint8* GetBoneCount() const;
    void SetBoneCount(const quint8* count, size_t boneCount = 12);

    quint8 GetNotifyCount() const;
    void SetNotifyCount(quint8 count);

    quint8 GetAssetType() const;
    void SetAssetType(quint8 type);

    bool IsPad() const;
    void SetIsPad(bool pad);

    quint16 GetRandomDataShortCount() const;
    void SetRandomDataShortCount(quint16 count);

    quint16 GetIndexCount() const;
    void SetIndexCount(quint16 count);

    float GetFramerate() const;
    void SetFramerate(float rate);

    float GetFrequency() const;
    void SetFrequency(float frequency);

    quint32 GetNamesPtr() const;
    void SetNamesPtr(quint32 ptr);

    quint16 GetNames() const;
    void SetNames(quint16 names);

    quint32 GetDataBytePtr() const;
    void SetDataBytePtr(quint32 ptr);

    quint8 GetDataByte() const;
    void SetDataByte(quint8 byte);

    quint32 GetDataShortPtr() const;
    void SetDataShortPtr(quint32 ptr);

    qint16 GetDataShort() const;
    void SetDataShort(qint16 shortValue);

    quint32 GetDataIntPtr() const;
    void SetDataIntPtr(quint32 ptr);

    int GetDataInt() const;
    void SetDataInt(int value);

    quint32 GetRandomDataShortPtr() const;
    void SetRandomDataShortPtr(quint32 ptr);

    qint16 GetRandomDataShort() const;
    void SetRandomDataShort(qint16 shortValue);

    quint32 GetRandomDataBytePtr() const;
    void SetRandomDataBytePtr(quint32 ptr);

    quint8 GetRandomDataByte() const;
    void SetRandomDataByte(quint8 byte);

    quint32 GetRandomDataIntPtr() const;
    void SetRandomDataIntPtr(quint32 ptr);

    int GetRandomDataInt() const;
    void SetRandomDataInt(int value);

    XAnimIndices& GetIndices();
    const XAnimIndices& GetIndices() const;
    void SetIndices(const XAnimIndices& indices);

    qint32 GetNotifyPtr() const;
    void SetNotifyPtr(qint32 ptr);

    XAnimNotifyInfo& GetNotify();
    const XAnimNotifyInfo& GetNotify() const;
    void SetNotify(const XAnimNotifyInfo& notify);

    qint32 GetDeltaPartPtr() const;
    void SetDeltaPartPtr(qint32 ptr);

    XAnimDeltaPart& GetDeltaPart();
    const XAnimDeltaPart& GetDeltaPart() const;
    void SetDeltaPart(const XAnimDeltaPart& deltaPart);

private:
    QString mName;
    quint32 mNamePtr = 0;

    quint16 mDataByteCount = 0;
    quint16 mDataShortCount = 0;
    quint16 mDataIntCount = 0;
    quint16 mRandomDataByteCount = 0;
    quint16 mRandomDataIntCount = 0;
    quint16 mNumFrames = 0;

    bool mIsLoop = false;
    bool mIsDelta = false;

    quint8 mBoneCount[12] = {0};
    quint8 mNotifyCount = 0;
    quint8 mAssetType = 0;

    bool mPad = false;

    quint16 mRandomDataShortCount = 0;
    quint16 mIndexCount = 0;

    float mFramerate = 0.0f;
    float mFrequency = 0.0f;

    quint32 mNamesPtr = 0;
    quint16 mNames = 0;

    quint32 mDataBytePtr = 0;
    quint8 mDataByte = 0;

    quint32 mDataShortPtr = 0;
    qint16 mDataShort = 0;

    quint32 mDataIntPtr = 0;
    int mDataInt = 0;

    quint32 mRandomDataShortPtr = 0;
    qint16 mRandomDataShort = 0;

    quint32 mRandomDataBytePtr = 0;
    quint8 mRandomDataByte = 0;

    quint32 mRandomDataIntPtr = 0;
    int mRandomDataInt = 0;

    XAnimIndices mIndices;

    qint32 mNotifyPtr = 0;
    XAnimNotifyInfo mNotify;

    qint32 mDeltaPartPtr = 0;
    XAnimDeltaPart mDeltaPart;
};

#endif // XANIMPARTS_H








