#pragma once

#include "MW4.hpp"

#include <Adept\Entity.hpp>

namespace MechWarrior4
{

	//##########################################################################
	//###########################   DeathEntity::GameModel    ##################
	//##########################################################################

	class DeathEntity__GameModel:
		public Adept::Entity::GameModel
	{
	public:
		int
			m_craterID;
		
		static void
			ConstructGameModel(Script *script);
	};


	typedef Adept::Entity__CreateMessage				DeathEntity__CreateMessage;
	typedef Adept::Entity__ExecutionStateEngine			DeathEntity__ExecutionStateEngine;
	typedef Adept::Entity__Message						DeathEntity__Message;
	typedef Adept::Entity__ClassData					DeathEntity__ClassData;

	//##########################################################################
	//##########################    DeathEntity    #############################
	//##########################################################################

	class DeathEntity:
		public Adept::Entity
	{
	public:
		static void
			InitializeClass();
		static void
			TerminateClass();

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Run-time Construction and Destruction Support
	//
	public:
		typedef DeathEntity__CreateMessage						CreateMessage;
		typedef DeathEntity__GameModel							GameModel;
		typedef DeathEntity__Message							Message;
		typedef DeathEntity__ClassData							ClassData;
		typedef DeathEntity__ExecutionStateEngine				ExecutionStateEngine;

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Run-time Construction and Destruction Support
	//
	public:
		static DeathEntity* 
			Make(
				CreateMessage *message,
				ReplicatorID *base_id
			);

	protected:
		DeathEntity(
			ClassData *class_data,
			CreateMessage *message,
			ReplicatorID *base_id,
			ElementRenderer::Element *element
		);

		~DeathEntity();

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Class Data support
	//
	protected:
		static Stuff::SortedChainOf<DeathEntity*, Stuff::Time>
			*DeathEntities;

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Class Data support
	//
	public:
		static ClassData
			*DefaultData;

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Game Model Support
	//
	public:
		const GameModel*
			GetGameModel()
				{
					Check_Object(this);
					return Cast_Pointer(const GameModel*,gameModelResource.GetPointer());
				}

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Flag Support
	//
	public:
		enum 
		{
			DefaultFlags = HermitMode
		};

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Test Support
	//
	public:
		void
      		TestInstance() const;
	};

}


