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

#pragma once

#include "glmRTTI.h"

namespace glm
{
	struct AssetManagerV3;
	struct RenderingTypeV0;

	/**
	* \brief Crowd Rendering Type
	*/
	struct GLM_CORE_API RenderingTypeV1
	{
		GLM_RTTI("88cebf75-c657-419f-b159-5e6b78b53943", RenderingTypeV1, addAttributes)
	public:

		GLM_CLASS_STAT_ID( glm::MemoryStatIds::GolaemShared);

		/// The name of the rendering type
		glm::GlmString _name;

		/// The weights of assets, by asset group name
		glm::Array<std::pair<glm::GlmString, glm::PODArray<float> > > _assetWeights;

		/// The asset manager this rendering type is associated to
		AssetManagerV3* _assetManager;

		/// The number of entities that use this rendering type
		unsigned int _ownCount;

		/// The parent rendering type
		RenderingTypeV1* _parent;

		/// The child rendering types
		glm::PODArray<RenderingTypeV1*> _children;

		RenderingTypeV1();
		~RenderingTypeV1();

		/**
		* \brief V0 backwards compatibility
		*/
		void createFromV0(RenderingTypeV0& renderingTypeV0);

		/**
		* \brief Duplicate the RenderingTypes AND its children, but keep the _parent to the same value
		*/
		void duplicateWithChildren(const RenderingTypeV1& src);

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

