
#pragma once

#include "MW4.hpp"
#include "Vehicle.hpp"

namespace MechWarrior4
{	
	//##########################################################################
	//############################    Boat    ###############################
	//##########################################################################

	//-------------------------------------------------------------------------
	// The following helper classes must always be typedef'd or overriden by an
	// inheritor
	//
	typedef Vehicle__GameModel				Boat__GameModel;
	typedef Vehicle__Message				Boat__Message;
	typedef Vehicle__UpdateMessage			Boat__UpdateMessage;
	typedef Vehicle__CreateMessage			Boat__CreateMessage;
	typedef Vehicle__ClassData				Boat__ClassData;
	typedef Vehicle__ExecutionStateEngine	Boat__ExecutionStateEngine;

	extern DWORD Executed_Boat_Count;

	//-----------------------  End of inheritance stuff ------------------------

	class Boat:
		public Vehicle
	{
	public:
		static void InitializeClass();
		static void TerminateClass();

		typedef Vehicle BaseClass;

	//##########################################################################
	// Inheritance support
	//
	public:
		typedef Boat__ClassData				ClassData;
		typedef Boat__GameModel				GameModel;
		typedef Boat__Message					Message;
		typedef Boat__ExecutionStateEngine		ExecutionStateEngine;
		typedef Boat__CreateMessage			CreateMessage;
	
	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Run-time Construction and Destruction Support
	//
	public:
		static Boat* Make(CreateMessage *message,ReplicatorID *base_id);

		void SaveInstanceText(Stuff::Page *page);

	protected:
		Boat(ClassData *class_data,CreateMessage *message,ReplicatorID *base_id,ElementRenderer::Element *element);
		
		void Respawn(Adept::Entity::CreateMessage *message);
		void CommonCreation(CreateMessage *message);

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

		~Boat();

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

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

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Execution Support
	//
	public:
		void TurnOn();
		void PreCollisionExecute(Stuff::Time till);
		void ComputeForwardSpeed(Stuff::Scalar time_slice);
		void UpdateVehiclePosition(const Stuff::Scalar time_slice );

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

}
