#pragma once

#include "MW4.hpp"

namespace MechWarrior4
{
	class Subsystem;
	
	//##########################################################################
	//########################   MaterialEffectHolder      #####################
	//##########################################################################

	class MaterialEffectHolder:
		public Stuff::Plug
	{

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Construction, Destruction, Testing
	//
	public:
		static void
			InitializeClass();
		static void
			TerminateClass();

		static void
			ConstructStream(
				Stuff::MemoryStream *stream,
				Stuff::NotationFile *model_file
			);
		void
			LoadEffectsChain(Stuff::MemoryStream *stream);

		MaterialEffectHolder(
			ClassData *class_data,
			Stuff::MemoryStream *stream
		);

		~MaterialEffectHolder();

		void
      		TestInstance() const;
	
	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Class Data support
	//
	public:
		static ClassData 
			*DefaultData;

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Simulation support
	//
	public:
		Adept::ResourceID
			GetEffectResource(int material);

		static int
			MaterialTypeTextToAscii(const char *mode_name);

	private:
		Stuff::SortedChainOf<Stuff::PlugOf<Adept::ResourceID>*, int>
			effectChain;
	};
}