//===========================================================================//
// File:	Buidling.hpp													
//---------------------------------------------------------------------------//
//   Date    Who  Modification                                               //
// --------  ---  ---------------------------------------------------------- //
// 05/06/99  DPB  Inital base class 
//---------------------------------------------------------------------------//
// Copyright (C) 1998, Fasa Interactive										 //
// All Rights reserved worldwide                                             //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL               //
//===========================================================================//

#pragma once

#include "MW4.hpp"
#include "Building.hpp"

namespace MechWarrior4
{
	
	//##########################################################################
	//###########################   Turret    ##################################
	//##########################################################################

	typedef Building__ClassData							Turret__ClassData;
	typedef Building__Message							Turret__Message;
	typedef Building__GameModel							Turret__GameModel;
	typedef Building__CreateMessage						Turret__CreateMessage;
	typedef Building__ExecutionStateEngine				Turret__ExecutionStateEngine;
	
	class Turret:
		public Building
	{
	public:
		static void
			InitializeClass();
		static void
			TerminateClass();

		typedef Building BaseClass;

	//##########################################################################
	// Inheritance support
	//
	public:
		typedef Turret__ClassData								ClassData;
		typedef Turret__GameModel								GameModel;
		typedef Turret__Message									Message;
		typedef Turret__ExecutionStateEngine					ExecutionStateEngine;
		typedef Turret__CreateMessage							CreateMessage;


	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Run-time Construction and Destruction Support
	//
	public:
		static Turret* 
			Make(
				CreateMessage *message,
				ReplicatorID *base_id
			);
		void
			Respawn(Adept::Entity::CreateMessage *message);
		void
			CommonCreation(CreateMessage *message);
// MSL 5.04 Merc
		void
			ReactToDestruction(int damage_mode, int damage_type);


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

		~Turret();

		void
			Reuse(
				const CreateMessage *message,
				ReplicatorID *base_id
			);

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

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Simulation Support
	//
	public:
		int
			GetTableArray()
				{Check_Object(this); return Adept::NameTable::TurretArray;}
	
	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Test Support
	//
	public:
		void
      		TestInstance() const;
	};
}


