/***************************************************************************
*                                                                          *
*  Copyright (C) Golaem S.A.  All Rights Reserved.                         *
*                                                                          *
***************************************************************************/

#pragma once

#include "glmCoreAPI.h"
#include "glmRTTI.h"
#include "glmAssetGroupV1.h"
#include "glmGolaemCharacterBlindDataOverride.h"
#include "glmGolaemCharacterSkeletonOverride.h"
#include "glmMeshAssetV3.h"
#include "glmGeometryAssetV2.h"
#include "glmShadingGroup.h"
#include "glmRenderingType.h"
#include "glmGenericSpecificConverterMappingV7.h"
#include "glmCharacterUserData.h"
#include "glmShaderAssetV1.h"
#include "glmShaderAttribute.h"
#include "glmClothAsset.h"
#include "glmShaderAttributeV1.h"
#include "glmRenderingTypeV3.h"
#include "glmGolaemCharacterInterface.h"

namespace glm
{
    struct GolaemCharacterV12;

    struct GLM_CORE_API GolaemCharacterV13 : public GolaemCharacterInterface
    {
        GLM_VIRTUAL_RTTI("dad9c48c-cc39-4274-b5a9-308e6ecbdfee", glm::GolaemCharacterV13, addAttributes);

    public:
        GLM_CLASS_STAT_ID( glm::MemoryStatIds::Simulation);

        /// Name of the character
        glm::GlmString _name;
        int _fileVersion;

        glm::PODArray<int> _mainAssetGroups;
        glm::PODArray<int> _mainShaderAttributes;

        glm::Array<AssetGroupV1> _allAssetGroups;
        glm::Array<MeshAssetV3> _meshAssets;

        glm::GlmMap<short, glm::Array<GeometryAssetV2>> _geometryAssetsPerTags;

        glm::Array<ShadingGroupV1> _shadingGroups;

        glm::Array<ShaderAttributeV1> _shaderAttributes;

        glm::Array<ShaderAssetV1> _shaderAssets;

        glm::Array<RenderingTypeV3> _renderingTypes;

        GenericSpecificConverterMappingV7 _converterMapping; // animation data
        CharacterUserDataV0 _characterUserData;              // additional user data

        Array<SkeletonOverrideV0> _skeletonOverrides;
        Array<BlindDataOverrideV0> _blindDataOverrides;

        GolaemCharacterV13();
        ~GolaemCharacterV13();

        /**
		* \brief V11 backwards compatibility
		* \note MeshAsset has a furAsset now
		*/
        void createFromV12(GolaemCharacterV12& characterV12);

        // Accessors
        const GenericSpecificConverterMappingV7& getConverterMapping() const;
        void setConverterMapping(const GenericSpecificConverterMappingV7& mapping);
        const CharacterUserDataV0& getCharacterUserData() const;
        void setCharacterUserData(const CharacterUserDataV0& userData);

    private:
        GLM_DISALLOW_COPY_AND_ASSIGN(GolaemCharacterV13);
        static void addAttributes();
    };
} // namespace glm
