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

#pragma once

#include "glmRTTI.h"
#include "glmCoreAPI.h"
#include "glmAssetGroup.h" // for AssetUnitV3 definition. will need to be versionned in a different file in the future

#include <glmGolaemCharacterDeclarations.h> // GolaemCharacter declarations

namespace glm
{
    struct AssetGroupV2;

    /**
	* \brief Group of assets
	*/
    struct AssetGroupV3
    {
        GLM_RTTI("eb4d64a1-ae00-4e23-a036-1ecfbe892d5c", AssetGroupV3, addAttributes);

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

        /// The name of the group
        glm::GlmString _name;

        /// The children
        glm::Array<AssetUnitV3> _children;

        glm::PODArray<float> _weights; // if weights are empty all the children are selected

        glm::Array<AssetUnitV3> _excludedAssets;

		AssetGroupV3();
        ~AssetGroupV3();

        void createFromV2(const AssetGroupV2& AssetGroupV2);

        /**
		* \brief Erases a child from this group
		*/
        void eraseChild(unsigned int childIndex);

        void getAllMeshAssets(glm::PODArray<int>& meshAssets, const GolaemCharacter& character) const;

    protected:
        /**
		* \brief Inspection needed method declaring the inspectable attributes.
		*/
        static void addAttributes();
    };
} // namespace glm
