/***************************************************************************
*                                                                          *
*  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 "glmGenericSpecificConverterMappingV6.h"
#include "glmCharacterUserData.h"
#include "glmShaderAssetV1.h"
#include "glmShaderAttributeV0.h"
#include "glmClothAsset.h"
#include "glmRenderingTypeV3.h"
#include "glmGolaemCharacterInterface.h"

namespace glm
{
    struct GolaemCharacterV6;

    struct GLM_CORE_API GolaemCharacterV7 : public GolaemCharacterInterface
    {
        GLM_VIRTUAL_RTTI("62db6974-1829-4f42-98cf-8da254262371", glm::GolaemCharacterV7, 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::Array<GeometryAssetV1> _geometryAssets;

        glm::Array<ShadingGroupV1> _shadingGroups;

        glm::Array<ShaderAttributeV0> _shaderAttributes;

        glm::Array<ShaderAssetV1> _shaderAssets;

        glm::Array<RenderingTypeV3> _renderingTypes;

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

        GolaemCharacterV7();
        ~GolaemCharacterV7();

        /**
		* \brief V6 backwards compatibility
		* \note MeshAsset had no ClothAsset
		*/
        void createFromV6(GolaemCharacterV6& characterV6);

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

        // for serialization only
        const GenericSpecificConverterMappingV6& getConverterMapping() const;
        void setConverterMapping(const GenericSpecificConverterMappingV6& mapping);
        const CharacterUserDataV0& getCharacterUserData() const;
        void setCharacterUserData(const CharacterUserDataV0& userData);
    };
} // namespace glm
