




#ifndef XPATHNODECONSTANT_H
#define XPATHNODECONSTANT_H

#include "xasset.h"
#include "xnodetype.h"
#include "xpathlink.h"

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

    void ParseData(QDataStream *aStream) override;

    NodeType GetType() const;
    void SetType(NodeType type);

    unsigned short GetSpawnflags() const;
    void SetSpawnflags(unsigned short flags);

    unsigned short GetTargetname() const;
    void SetTargetname(unsigned short name);

    unsigned short GetScriptLinkName() const;
    void SetScriptLinkName(unsigned short name);

    unsigned short GetScriptNoteworthy() const;
    void SetScriptNoteworthy(unsigned short noteworthy);

    unsigned short GetTarget() const;
    void SetTarget(unsigned short target);

    unsigned short GetAnimscript() const;
    void SetAnimscript(unsigned short script);

    int GetAnimscriptfunc() const;
    void SetAnimscriptfunc(int func);

    const float* GetOrigin() const;
    void SetOrigin(const float* origin, size_t count = 3);

    float GetAngle() const;
    void SetAngle(float angle);

    const float* GetForward() const;
    void SetForward(const float* forward, size_t count = 2);

    float GetRadius() const;
    void SetRadius(float radius);

    float GetMinUseDistSq() const;
    void SetMinUseDistSq(float dist);

    short GetOverlapNode(int index) const;
    void SetOverlapNode(int index, short node);

    short GetChainId() const;
    void SetChainId(short id);

    short GetChainDepth() const;
    void SetChainDepth(short depth);

    short GetChainParent() const;
    void SetChainParent(short parent);

    unsigned short GetTotalLinkCount() const;
    void SetTotalLinkCount(unsigned short count);

    XPathLink* GetLinks() const;
    void SetLinks(XPathLink* links, unsigned short count);

private:
    NodeType mType = NodeType::NODE_BADNODE;
    unsigned short mSpawnflags = 0;
    unsigned short mTargetname = 0;
    unsigned short mScriptLinkName = 0;
    unsigned short mScriptNoteworthy = 0;
    unsigned short mTarget = 0;
    unsigned short mAnimscript = 0;
    int mAnimscriptfunc = 0;
    float mOrigin[3] = {0.0f, 0.0f, 0.0f};
    float mAngle = 0.0f;
    float mForward[2] = {0.0f, 0.0f};
    float mRadius = 0.0f;
    float mMinUseDistSq = 0.0f;
    short mOverlapNode[2] = {0, 0};
    short mChainId = 0;
    short mChainDepth = 0;
    short mChainParent = 0;
    unsigned short mTotalLinkCount = 0;
    XPathLink* mLinks = nullptr; // We'll need to manage memory for this array
};

#endif // XPATHNODECONSTANT_H




