#ifndef XFXELEMDEF_H
#define XFXELEMDEF_H

#include "xasset.h"
#include "xfxspawndef.h"
#include "xfxfloatrange.h"
#include "xfxintrange.h"
#include "xfxelematlas.h"
#include "xfxelemvelstatesample.h"
#include "xfxelemvisstatesample.h"
#include "xeffectdefref.h"
#include "xfxelemdefvisuals.h"
#include "xfxtraildef.h"

class XFxElemDef : public XAsset
{
public:
    explicit XFxElemDef();
    ~XFxElemDef();

    void Clear() override;
    void ParseData(QDataStream *aStream) override;

private:
    int mFlags;
    XFxSpawnDef mSpawn;
    XFxFloatRange mSpawnRange;
    XFxFloatRange mFadeInRange;
    XFxFloatRange mFadeOutRange;
    float mSpawnFrustumCullRadius;
    XFxIntRange mSpawnDelayMsec;
    XFxIntRange mLifeSpanMsec;
    QVector<XFxFloatRange> mSpawnOrigin;
    XFxFloatRange mSpawnOffsetRadius;
    XFxFloatRange mSpawnOffsetHeight;
    QVector<XFxFloatRange> mSpawnAngles;
    QVector<XFxFloatRange> mAngularVelocity;
    XFxFloatRange mInitialRotation;
    XFxFloatRange mGravity;
    XFxFloatRange mReflectionFactor;
    XFxElemAtlas mAtlas;
    quint8 mElemType;
    quint8 mVisualCount;
    quint8 mVelIntervalCount;
    quint8 mVisStateIntervalCount;
    qint32 mVelSamplesPtr;
    QVector<XFxElemVelStateSample> mVelSamples;
    qint32 mVisSamplesPtr;
    QVector<XFxElemVisStateSample> mVisSamples;
    XFxElemDefVisuals mVisuals;
    QVector3D mCollMins;
    QVector3D mCollMaxs;
    XEffectDefRef mEffectOnImpact;
    XEffectDefRef mEffectOnDeath;
    XEffectDefRef mEffectEmitted;
    XFxFloatRange mEmitDist;
    XFxFloatRange mEmitDistVariance;

    XFxTrailDef mTrailDef;

    quint8 mSortOrder;
    quint8 mLightingFrac;
    quint8 mUseItemClip;
};

#endif // XFXELEMDEF_H
