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

#pragma once

#include "glmCoreAPI.h"
#include "glmRTTI.h"
#include "glmAttribute.h"
#include "glmAssetGroupV0.h"
#include "glmMeshAssetV2.h"
#include "glmGeometryAssetV1.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 GolaemCharacterV9;

    struct GLM_CORE_API GolaemCharacterV10 : public GolaemCharacterInterface
    {
        GLM_VIRTUAL_RTTI("7e5aa2bc-fb06-4abf-9b84-32812f0d1925", glm::GolaemCharacterV10, addAttributes);

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

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

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

        glm::Array<AssetGroupV0> _allAssetGroups;
        glm::Array<MeshAssetV2> _meshAssets;

        glm::GlmMap<short, glm::Array<GeometryAssetV1>> _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

        GolaemCharacterV10();
        ~GolaemCharacterV10();

        /**
		* \brief V7 backwards compatibility
		* \note MeshAsset had no ClothAsset
		*/
        void createFromV9(GolaemCharacterV9& characterV8);

    private:
        GLM_DISALLOW_COPY_AND_ASSIGN(GolaemCharacterV10);
        static void addAttributes();

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