//===========================================================================//
// File:	AnimationState.hpp											
//---------------------------------------------------------------------------//
//   Date    Who  Modification                                               //
// --------  ---  ---------------------------------------------------------- //
// 02/23/999  JSE  Inital coding
//---------------------------------------------------------------------------//
// Copyright (C) 1998, Microsoft Corp.										 //
// All Rights reserved worldwide                                             //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL               //
//===========================================================================//


#pragma once

#include "AnimationState.hpp"

namespace MechWarrior4 
{

	class Vehicle;
	class Mech;
	                                                                                   
	class MechAnimationStateEngine:
		public AnimationStateEngine
	{
		

	public:
		static void
			InitializeClass();
		static void
			TerminateClass();

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Run-time Construction and Destruction Support
	//
	public:
		static MechAnimationStateEngine*
			Make(Vehicle *vehicle, const FactoryRequest *request);

		void
			Save(FactoryRequest *request);
		void
			Reuse(const FactoryRequest *request);

		~MechAnimationStateEngine();

	protected:
		MechAnimationStateEngine(
			Vehicle *vehicle,
			ClassData *class_data,
			const FactoryRequest *request
		);


	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Shared Data support
	//
	public:
		ClassData*
			GetClassData();

		static ClassData
			*DefaultData;

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// State entries
	//




	public:
		enum {
			StandState = AnimationStateEngine::StateCount,//10
			StandHalfState,
			
			Stand_1_8_thState,
			Stand_2_8_thState,
			Stand_3_8_thState,
			Stand_5_8_thState,
			Stand_6_8_thState,
			Stand_7_8_thState,
			
			ForwardState,//18
			BackwardState,

			TurnLeftState,
			TurnRightState,

			LGimpTurnRightState,
			RGimpTurnRightState,
			LGimpTurnLeftState,
			RGimpTurnLeftState,

			GimpStandLeftState,
			GimpForwardLeftState,
			GimpStandRightState,
			GimpForwardRightState,

			FallForwardState,
			FallBackwardState,
			FallLeftState,
			FallRightState,
			FallCataclysmicState,

			PowerDownState,
			PowerDownCataclysmicState,

			CrouchState,
			FlyState,

			StateCount
		};

	
	protected:
		static const StateEntry
			StateEntries[];


	public:
		int
			RequestState(
				int new_state,
				bool run_minimal = false,
				void* data = NULL
				);

		void
			RunStates(Stuff::Scalar time_slice, bool run_minimal = false);

		
		Mech *
			m_Mech;

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Test Support
	//
	public:
		void
      		TestClass();
	};

	//#############################################################################
	//##########################			Inlines		   ########################
	//#############################################################################

	inline MechAnimationStateEngine::ClassData*
		MechAnimationStateEngine::GetClassData()
	{
		Check_Object(this);
		return Cast_Pointer(ClassData*, classData);
	}



}

