#ifndef XCOMPRIMARYLIGHT_H
#define XCOMPRIMARYLIGHT_H

#include "xasset.h"
#include "xstring.h"

#include <QVector3D>
#include <QColor>

class XComPrimaryLight;
typedef QVector<XComPrimaryLight*> XComPrimaryLightArray;

class XComPrimaryLight : public XAsset
{
public:
    XComPrimaryLight();
    ~XComPrimaryLight();

    quint8 GetType() const;
    quint8 GetCanUseShadowMap() const;
    quint8 GetExponent() const;
    quint8 GetUnused() const;
    QColor GetColor() const;
    QVector3D GetDir() const;
    QVector3D GetOrigin() const;
    float GetRadius() const;
    float GetCosHalfFovOuter() const;
    float GetCosHalfFovInner() const;
    float GetCosHalfFovExpanded() const;
    float GetRotationLimit() const;
    float GetTranslationLimit() const;

    static XComPrimaryLightArray* ParseArray(XDataStream *aStream, int aCount);

    virtual void Clear() override;
    virtual void ParseData(XDataStream *aStream) override;

public slots:
    void SetType(quint8 aType);
    void SetCanUseShadowMap(quint8 aCanUseShadowMap);
    void SetExponent(quint8 aExponent);
    void SetUnused(quint8 aUnused);
    void SetColor(const QColor aColor);
    void SetDir(const QVector3D aDir);
    void SetOrigin(const QVector3D aOrigin);
    void SetRadius(float aRadius);
    void SetCosHalfFovOuter(float aCosHalfFovOuter);
    void SetCosHalfFovInner(float aCosHalfFovInner);
    void SetCosHalfFovExpanded(float aCosHalfFovExpanded);
    void SetRotationLimit(float aRotationLimit);
    void SetTranslationLimit(float aTranslationLimit);

private:
    quint8    mType;
    quint8    mCanUseShadowMap;
    quint8    mExponent;
    quint8    mUnused;
    QColor    mColor;
    QVector3D mDir;
    QVector3D mOrigin;
    float     mRadius;
    float     mCosHalfFovOuter;
    float     mCosHalfFovInner;
    float     mCosHalfFovExpanded;
    float     mRotationLimit;
    float     mTranslationLimit;
    XString   mDefName;
};

#endif // XCOMPRIMARYLIGHT_H
