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

#pragma once

#include "glmCoreAPI.h"
#include "glmRTTI.h"
#include "glmAssetGroupV0.h"
#include "glmGeometryAssetV1.h"
#include "glmMeshAssetV2.h"
#include "glmShadingGroup.h"
#include "glmRenderingType.h"
#include "glmGenericSpecificConverterMappingV7.h"
#include "glmCharacterUserData.h"
#include "glmShaderAssetV1.h"
#include "glmShaderAttributeV0.h"
#include "glmClothAsset.h"
#include "glmMeshAssetV2.h"
#include "glmRenderingTypeV3.h"
#include "glmGolaemCharacterInterface.h"

namespace glm
{
    struct GolaemCharacterV8;

    struct GLM_CORE_API GolaemCharacterV9 : public GolaemCharacterInterface
    {
        GLM_VIRTUAL_RTTI("2f3a68bd-6c6f-4e50-a083-66845cefb6e8", glm::GolaemCharacterV9, addAttributes);

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

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

        glm::PODArray<int> _mainAssetGroups;

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

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

        glm::Array<ShadingGroupV1> _shadingGroups;

        glm::Array<ShaderAttributeV0> _shaderAttributes;

        glm::Array<ShaderAssetV1> _shaderAssets;

        glm::Array<RenderingTypeV3> _renderingTypes;

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

        GolaemCharacterV9();
        ~GolaemCharacterV9();

        /**
		* \brief V7 backwards compatibility
		* \note MeshAsset had no ClothAssetV0
		*/
        void createFromV8(GolaemCharacterV8& characterV8);

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

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