// *******************************************************************************************************
// 									Actions functions
// *******************************************************************************************************

	// --------------------------------------------------------------------------------------------------------------
	//								Generic actions functions
	// --------------------------------------------------------------------------------------------------------------
	// to help declare lists of actions
		// fast forward (ex : crawlFast)
			#define RTMACTIONS_RUNACTIONSLIST_FF(State,Stance,Action,Class) \
				##Action##F=##State##Stance##Class##F;
		// side forward (to complete FF)
			#define RTMACTIONS_RUNACTIONSLIST_SF(State,Stance,Action,Class) \
				##Action##RF=##State##Stance##Class##RF; \
				##Action##LF=##State##Stance##Class##LF;
		// forward (ex: sprint)
			#define RTMACTIONS_RUNACTIONSLIST_F(State,Stance,Action,Class) \
				RTMACTIONS_RUNACTIONSLIST_FF(State,Stance,Action,Class) \
				RTMACTIONS_RUNACTIONSLIST_SF(State,Stance,Action,Class)
		// sideways (ex: lean)
			#define RTMACTIONS_RUNACTIONSLIST_S(State,Stance,Action,Class) \
				##Action##R=##State##Stance##Class##R; \
				##Action##L=##State##Stance##Class##L;
		// backward (walk etc...)
			#define RTMACTIONS_RUNACTIONSLIST_B(State,Stance,Action,Class) \
				##Action##RB=##State##Stance##Class##RB; \
				##Action##LB=##State##Stance##Class##LB; \
				##Action##B=##State##Stance##Class##B;
			
		// all directions
			#define RTMACTIONS_RUNACTIONSLIST(State,Stance,Action,Class) \
				RTMACTIONS_RUNACTIONSLIST_F(State,Stance,Action,Class) \
				RTMACTIONS_RUNACTIONSLIST_S(State,Stance,Action,Class) \
				RTMACTIONS_RUNACTIONSLIST_B(State,Stance,Action,Class)
	// examples :
		//	RTMACTIONS_RUNACTIONSLIST_F(Rifle,Stand,fast,Sprint)
		//	RTMACTIONS_RUNACTIONSLIST_S(Rifle,Stand,fast,Lean)
		//	RTMACTIONS_RUNACTIONSLIST(Rifle,Stand,slow,Run)

	// --------------------------------------------------------------------------------------------------------------
	//								Basic default actions
	// --------------------------------------------------------------------------------------------------------------
	// used to declare generic actions within main action classes
	
		// stop, stoprelaxed,default,die
			#define RTMACTIONS_Basic(State,Stance) \
				BinocOn=##State##Stance##Binoc; \
				ThrowGrenade=##State##Stance##ThrowGrenadeStart; \
				getInCar=##State##StandGetInCar; \
				getOutCar=##State##StandStand; \
				getInTank=##State##StandGetInTank; \
				getOutTank=##State##StandGetOutTank; \
				ladderOnDown=##State##StandLadderDownStart; \
				ladderOnUp=##State##StandLadderUpStart;

		// up, down
			#define RTMACTIONS_UpDown(State,Up,Down) \
				up=##State##Up##; \
				down=##State##Down##;
				#define RTMACTIONS_StandUpDown(State) RTMACTIONS_UpDown(State,Crouch,Lying)
				#define RTMACTIONS_CrouchUpDown(State) RTMACTIONS_UpDown(State,Stand,Lying)
				#define RTMACTIONS_LyingUpDown(State) RTMACTIONS_UpDown(State,Crouch,Stand)
				#define RTMACTIONS_SafeStandUpDown(State) RTMACTIONS_UpDown(State,SafeCrouch,Lying)
				#define RTMACTIONS_SafeCrouchUpDown(State) RTMACTIONS_UpDown(State,SafeStand,Lying)
			
		// turnspeed, limitfast
			#define RTMACTIONS_Speeds(tspeed,lfast) \
				turnSpeed=##tspeed##; \
				limitFast=##lfast##;
				#define RTMACTIONS_StandSpeeds RTMACTIONS_Speeds(4,5.5) // was 8,5.5
				#define RTMACTIONS_CrouchSpeeds RTMACTIONS_Speeds(2,5.5) // was 8,5.5
				#define RTMACTIONS_LyingSpeeds RTMACTIONS_Speeds(0.5,5.5) // was 3,5.5
				#define RTMACTIONS_SafeStandSpeeds RTMACTIONS_Speeds(2,2.5) // was 4,2.5
				#define RTMACTIONS_SafeCrouchSpeeds RTMACTIONS_Speeds(1,2.5) // was 4,2.5
				#define RTMACTIONS_SafeLyingSpeeds RTMACTIONS_Speeds(0.5,2.5) // was 3,2.5
			
		// HandgunOn, HandgunOff, etc..
			#define RTMACTIONS_StateChange(State,SafeState,Stance) \
				HandGunOn=##State##Pistol##Stance##; \
				HandGunOff=##State##Stance##; \
				BinocOn=##State##Stance##Binoc; \
				BinocOff=##State##Stance##; \
				Civil=CivilStand; \
				CivilLying=CivilLying; \
				WeaponOn=ATCrouch; \
				WeaponOff=##SafeState##Stance##; \
				Combat=Rifle##Stance##; \
				Stand=##State##Stand; \
				Crouch=##State##Crouch; \
				Lying=##State##Lying; \
				fireNotPossible=##State##Stance##;
				
			#define RTMACTIONS_SafeStateChange(State,CombatState,Stance) \
				HandGunOn=##CombaState##Pistol##Stance##; \
				HandGunOff=##State##Stance##; \
				BinocOn=##State##Stance##Binoc; \
				BinocOff=##State##Stance##; \
				Civil=CivilStand; \
				CivilLying=CivilLying; \
				WeaponOn=ATCrouch; \
				WeaponOff=##State##Stance##; \
				Combat=Rifle##Stance##; \
				Stand=##State##Stand; \
				Crouch=##State##Crouch; \
				Lying=##State##Lying; \
				fireNotPossible=##CombatState##Stance##;

		// Run
			// combat run
				#define RTMACTIONS_Run(State,Stance) \
					RTMACTIONS_RUNACTIONSLIST(State,Stance,walk,Walk) \
					RTMACTIONS_RUNACTIONSLIST(State,Stance,slow,Run) \
					RTMACTIONS_RUNACTIONSLIST_F(State,Stance,fast,Sprint) \
					RTMACTIONS_RUNACTIONSLIST_S(State,Stance,fast,Run) \
					RTMACTIONS_RUNACTIONSLIST_B(State,Stance,fast,Run)
			// safe run
				#define RTMACTIONS_SafeRun(State,Stance) \
					RTMACTIONS_RUNACTIONSLIST(State,Stance,walk,Walk) \
					RTMACTIONS_RUNACTIONSLIST(State,Stance,slow,Walk) \
					RTMACTIONS_RUNACTIONSLIST(State,Stance,fast,Run)				
		// Crawl
			#define RTMACTIONS_Crawl(State) \
				RTMACTIONS_RUNACTIONSLIST(State,Lying,walk,Crawl) \
				RTMACTIONS_RUNACTIONSLIST(State,Lying,slow,Crawl) \
				RTMACTIONS_RUNACTIONSLIST_FF(State,Lying,fast,CrawlFast) \
				RTMACTIONS_RUNACTIONSLIST_SF(State,Lying,fast,Crawl) \
				RTMACTIONS_RUNACTIONSLIST_S(State,Lying,fast,Crawl) \
				RTMACTIONS_RUNACTIONSLIST_B(State,Lying,fast,Crawl)
			
			
	// --------------------------------------------------------------------------------------------------------------
	//								Action classes
	// --------------------------------------------------------------------------------------------------------------
	// used to declare specific actions classes
	
		// Default Variant Actions
			#define RTMACTIONS_DefaultVar(State,Stance,Num) \
			class ##State##Stance##Num##Actions:##State##Stance##Actions \
				{ \
				stop=##State##Stance##Num##_loop; \
				};
			
		// Relaxed Variant Actions
			#define RTMACTIONS_RelaxedVar(State,Stance,Num) \
			class ##State##Stance##Relaxed##Num##Actions:##State##Stance##Actions \
				{ \
					stopRelaxed=##State##Stance##Relaxed##Num##_loop; \
				};
		// Binoc Actions
			#define RTMACTIONS_BINOC(State,Stance,manpos) \
			class ##State##Stance##BinocActions:##State##Stance##Actions \
				{ \
					stop=##State##Stance##Binoc; \
					default=##State##Stance##Binoc; \
					binocOff=##State##Stance##; \
					upDegree=##manpos##; \
				};
		// Combat Walk, Run, RunAim, Sprint Actions
			#define RTMACTIONS_COMBATRUNACTION(State,Stance,Up,Dir) \
				class ##State##Stance##Walk##Dir##Actions:##State##Stance##Actions \
				{ \
					up=##State##Up##Walk##Dir##; \
				}; \
				class ##State##Stance##Run##Dir##Actions:##State##Stance##Actions \
				{ \
					firenotpossible=##State##Stance##RunAim##Dir##; \
					ThrowGrenade=##State##Stance##RunThrowGrenadeStart; \
					up=##State##Up##Run##Dir##; \
				}; \
				class ##State##Stance##RunAim##Dir##Actions:##State##Stance##Actions \
				{ \
					RTMACTIONS_RUNACTIONSLIST(State,Stance,slow,RunAim) \
					RTMACTIONS_RUNACTIONSLIST(State,Stance,fast,Run) \
					ThrowGrenade=##State##Stance##RunThrowGrenadeStart; \
					up=##State##Up##RunAim##Dir##; \
				}; \
				class ##State##Stance##Sprint##Dir##Actions:##State##Stance##Actions \
				{ \
					firenotpossible=##State##Stance##RunAim##Dir##; \
					ThrowGrenade=##State##Stance##RunThrowGrenadeStart; \
					up=##State##Up##Sprint##Dir##; \
				};
			#define RTMACTIONS_COMBATRUNACTIONS(State,Stance,Up) \
				RTMACTIONS_COMBATRUNACTION(State,Stance,Up,F) \
				RTMACTIONS_COMBATRUNACTION(State,Stance,Up,RF) \
				RTMACTIONS_COMBATRUNACTION(State,Stance,Up,LF) \
				RTMACTIONS_COMBATRUNACTION(State,Stance,Up,R) \
				RTMACTIONS_COMBATRUNACTION(State,Stance,Up,L) \
				RTMACTIONS_COMBATRUNACTION(State,Stance,Up,RB) \
				RTMACTIONS_COMBATRUNACTION(State,Stance,Up,LB) \
				RTMACTIONS_COMBATRUNACTION(State,Stance,Up,B)
			
		// Safe Walk, Run, Sprint Actions
			#define RTMACTIONS_SAFERUNACTION(State,Stance,Up,Dir) \
				class ##State##Stance##Walk##Dir##Actions:##State##Stance##Actions \
				{ \
					up=##State##Up##Walk##Dir##; \
				}; \
				class ##State##Stance##Run##Dir##Actions:##State##Stance##Actions \
				{ \
					ThrowGrenade=##State##Stance##RunThrowGrenadeStart; \
					up=##State##Up##Run##Dir##; \
				}; \
				class ##State##Stance##Sprint##Dir##Actions:##State##Stance##Actions \
				{ \
					ThrowGrenade=##State##Stance##RunThrowGrenadeStart; \
					up=##State##Up##Sprint##Dir##; \
				};
			#define RTMACTIONS_SAFERUNACTIONS(State,Stance,Up) \
				RTMACTIONS_SAFERUNACTION(State,Stance,Up,F) \
				RTMACTIONS_SAFERUNACTION(State,Stance,Up,RF) \
				RTMACTIONS_SAFERUNACTION(State,Stance,Up,LF) \
				RTMACTIONS_SAFERUNACTION(State,Stance,Up,R) \
				RTMACTIONS_SAFERUNACTION(State,Stance,Up,L) \
				RTMACTIONS_SAFERUNACTION(State,Stance,Up,RB) \
				RTMACTIONS_SAFERUNACTION(State,Stance,Up,LB) \
				RTMACTIONS_SAFERUNACTION(State,Stance,Up,B)
		// Combat RunF Var Actions
			#define RTMACTIONS_COMBATRUNVARACTIONS(State,Stance,Num) \
				class ##State##Stance##RunF_V##Num##Actions:##State##Stance##RunFActions \
				{ \
					slowF=##State##Stance##RunF_V##Num##; \
					fastF=##State##Stance##SprintF_V##Num##; \
				}; \
				class ##State##Stance##SprintF_V##Num##Actions:##State##Stance##RunF_V##Num##Actions{};
		// Safe RunF Var Actions
			#define RTMACTIONS_SAFERUNVARACTIONS(State,Stance,Num) \
				class ##State##Stance##RunF_V##Num##Actions:##State##Stance##RunFActions \
				{ \
					fastF=##State##Stance##RunF_V##Num##; \
				}; \
				class ##State##Stance##SprintF_V##Num##Actions:##State##Stance##RunF_V##Num##Actions{};
		// Combat WalkF Var Actions
			#define RTMACTIONS_COMBATWALKVARACTIONS(State,Stance,Num) \
				class ##State##Stance##WalkF_V##Num##Actions:##State##Stance##WalkFActions \
				{ \
					walkF=##State##Stance##WalkF_V##Num##; \
				};
		// Safe WalkF Var Actions
			#define RTMACTIONS_SAFEWALKVARACTIONS(State,Stance,Num) \
				class ##State##Stance##WalkF_V##Num##Actions:##State##Stance##WalkFActions \
				{ \
					walkF=##State##Stance##WalkF_V##Num##; \
					slowF=##State##Stance##WalkF_V##Num##; \
				};
		
	// --------------------------------------------------------------------------------------------------------------
	//								Neutral Action classes
	// --------------------------------------------------------------------------------------------------------------
		
		// defines basic neutral action for one stance
		#define ECA_NEUTRALSTANCEACTIONS(State,Stance) \
		class ##State##Stance##NeutralActions: ##State##Stance##Actions \
		{ \
			die=Neutral##Stance##Dead;  \
		}
		
		// ladder actions
		#define ECA_NEUTRALLADDERACTIONS(State) \
		class ##State##StandLadderActions: NoActions \
		{ \
			stop=##State##StandLadderStatic; \
			default=##State##StandLadderStatic; \
			upDegree=ManPosStand; \
			turnSpeed=0.1; \
			ladderOnDown=##State##StandLadderDownStart; \
			ladderOnUp=##State##StandLadderUpStart; \
			ladderOff=##State##StandLadderDownEnd; \
			ladderOffTop=##State##StandLadderUpEnd; \
			ladderOffBottom=##State##StandLadderDownEnd; \
			down=##State##StandLadderDownLoop; \
			up=##State##StandLadderUpLoop; \
			die=NeutralStandDead; \
		}; \
		class ##State##StandLadderUpActions: ##State##StandLadderActions \
		{ \
			ladderOff=##State##StandLadderUpEnd; \
		}; \
		class ##State##StandLadderDownActions: ##State##StandLadderActions \
		{ \
			ladderOff=##State##StandLadderDownEnd; \
		}
		
		// defines basic neutral action for all stance
		#define ECA_NEUTRALACTIONS(State) \
		ECA_NEUTRALSTANCEACTIONS(State,Stand); \
			ECA_NEUTRALLADDERACTIONS(State); \
		ECA_NEUTRALSTANCEACTIONS(State,Crouch); \
		ECA_NEUTRALSTANCEACTIONS(State,Lying);
		
		
		
		