#ifndef XFXELEMDEF_H
#define XFXELEMDEF_H

#include "xasset.h"
#include "xeffectdef.h"
#include "xfxtraildef.h"

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

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

private:
    int mFlags;
    FxSpawnDef mSpawn;
    FxFloatRange mSpawnRange;
    FxFloatRange mFadeInRange;
    FxFloatRange mFadeOutRange;
    float mSpawnFrustumCullRadius;
    FxIntRange mSpawnDelayMsec;
    FxIntRange mLifeSpanMsec;
    QVector<FxFloatRange> mSpawnOrigin;
    FxFloatRange mSpawnOffsetRadius;
    FxFloatRange mSpawnOffsetHeight;
    QVector<FxFloatRange> mSpawnAngles;
    QVector<FxFloatRange> mAngularVelocity;
    FxFloatRange mInitialRotation;
    FxFloatRange mGravity;
    FxFloatRange mReflectionFactor;
    FxElemAtlas mAtlas;
    quint8 mElemType;
    quint8 mVisualCount;
    quint8 mVelIntervalCount;
    quint8 mVisStateIntervalCount;
    qint32 mVelSamplesPtr;
    QVector<FxElemVelStateSample> mVelSamples;
    qint32 mVisSamplesPtr;
    QVector<FxElemVisStateSample> mVisSamples;
    FxElemDefVisuals mVisuals;
    QVector3D mCollMins;
    QVector3D mCollMaxs;
    EffectDefRef mEffectOnImpact;
    EffectDefRef mEffectOnDeath;
    EffectDefRef mEffectEmitted;
    FxFloatRange mEmitDist;
    FxFloatRange mEmitDistVariance;

    qint32 mTrailDefPtr;
    XFxTrailDef *mTrailDef;

    quint8 mSortOrder;
    quint8 mLightingFrac;
    quint8 mUseItemClip;
};

#endif // XFXELEMDEF_H
