View Single Post
Re: Some CS.DLL sources...
Old
  (#4)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: Some CS.DLL sources... - 14-01-2013

interesting stuff

Code:
		class DefuseBombState : public BotState
		{
/*			public:
				virtual       void        OnEnter  (TemplateCSBot *const owner) = 0;
				virtual       void        OnUpdate (TemplateCSBot *const owner) = 0;
				virtual       void        OnExit   (TemplateCSBot *const owner) = 0;
				virtual const char *const GetName  (void) = 0;	// { return "DefuseBomb"; }
*/		};	// sizeof (DefuseBombState) == 4 (1)
		class HideState : public BotState
		{
			public:
				enum { MaximumHidingSpotsToPickNumber = 3u };

/*! off=4(1)/2840(710) */				NavigationArea *m_searchArea;
/*! off=8(2)/2844(711) */				float           m_searchRange;
/*! off=12(3)/2848(712) */				Math::Vector3D  m_hiddingSpot;
/*! off=24(6)/2860(715) */				bool            m_isAtSpot;
/*! off=28(7)/2864(716) */				float           m_duration;
/*! off=32(8)/2868(717) */				bool            m_holdPosition;	// Can bot hold position?
/*! off=36(9)/2872(718) */				float           m_holdPositionTimeAmount;
/*! off=40(10)/2876(719) */				bool            m_holdPositionAndWaitingEnemy;
/*! off=44(11)/2880(720) */				float           m_holdPositionStartTimestamp;
/*! off=48(12)/2884(721) */				unsigned int    m_hidingSpotPickTriesNumber;	// Up to 'MaximumHidingSpotsToPickNumber'.
/*! off=52(13)/2888(722) */				Math::Vector3D  m_followingTargetPosition;
/*
			public:
				virtual       void        OnEnter  (TemplateCSBot *const owner) = 0;
				virtual       void        OnUpdate (TemplateCSBot *const owner) = 0;
				virtual       void        OnExit   (TemplateCSBot *const owner) = 0;
				virtual const char *const GetName  (void) = 0;	// { return "Hide"; }
*/		};	// sizeof (HideState) == 64 (16)
		class EscapeFromBombState : public BotState
		{
/*			public:
				virtual       void        OnEnter  (TemplateCSBot *const owner) = 0;
				virtual       void        OnUpdate (TemplateCSBot *const owner) = 0;
				virtual       void        OnExit   (TemplateCSBot *const owner) = 0;
				virtual const char *const GetName  (void) = 0;	// { return "EscapeFromBomb"; }
*/		};	// sizeof (EscapeFromBombState) == 4 (1)
		class FollowState : public BotState
		{
			public:
/*! off=4(1)/2908(727) */				EntityHandle              m_leader;
/*! off=12(3)/2916(729) */				Math::Vector3D            m_UNKNOWN0;
/*! off=24(6)/2928(732) */				bool                      m_UNKNOWN1;
/*! off=28(7)/2932(733) */				unsigned int              m_UNKNOWN2;
/*! off=32(8)/2936(734) */				unsigned int              m_UNKNOWN3_Type;
/*! off=36(9)/2940(735) */				unsigned int              m_UNKNOWN4_Timestamp;
/*! off=40(10)/2944(736) */				bool                      m_UNKNOWN5;
/*! off=44(11)/2948(737) */				float                     m_UNKNOWN6_Timestamp;
/*! off=48(12)/2952(738) */				Utilities::CountdownTimer m_UNKNOWN7_Timer;
/*! off=56(14)/2960(740) */				float                     m_UNKNOWN8_Timestamp;
/*! off=60(15)/2964(741) */				bool                      m_UNKNOWN9;
/*! off=64(16)/2968(742) */				float                     m_UNKNOWN10_TimeAmount;
/*! off=68(17)/2972(743) */				Utilities::CountdownTimer m_UNKNOWN11_Timer;
/*
			public:
				virtual       void        OnEnter  (TemplateCSBot *const owner) = 0;
				virtual       void        OnUpdate (TemplateCSBot *const owner) = 0;
				virtual       void        OnExit   (TemplateCSBot *const owner) = 0;
				virtual const char *const GetName  (void) = 0;	// { return "Follow"; }
*/		};	// sizeof (FollowState) == 76 (19)
		class UseEntityState : public BotState
		{
			public:
/*! off=4(1)/2984(746) */				EntityHandle m_target;
/*
			public:
				virtual       void        OnEnter  (TemplateCSBot *const owner) = 0;
				virtual       void        OnUpdate (TemplateCSBot *const owner) = 0;
				virtual       void        OnExit   (TemplateCSBot *const owner) = 0;
				virtual const char *const GetName  (void) = 0;	// { return "UseEntity"; }
*/		};	// sizeof (UseEntityState) == 12 (3)
[...]
	public:
/*! off=2684(671) */		IdleState              m_idleState;
/*! off=2688(672) */		HuntState              m_huntState;
/*! off=2696(674) */		AttackState            m_attackState;											// Executed when variable 'm_isAttacking' is true no metter what....
/*! off=2756(689) */		InvestigateNoiseState  m_investigateNoiseState;
/*! off=2772(693) */		BuyState               m_buyState;
/*! off=2800(700) */		MoveToState            m_moveToState;
/*! off=2824(706) */		FetchBombState         m_fetchBombState;
/*! off=2828(707) */		PlantBombState         m_plantBombState;
/*! off=2832(708) */		DefuseBombState        m_defuseBombState;
/*! off=2836(709) */		HideState              m_hideState;
/*! off=2900(725) */		EscapeFromBombState    m_escapeFromBombState;
/*! off=2904(726) */		FollowState            m_followState;
/*! off=2980(745) */		UseEntityState         m_useEntityState;

/*! off=2992(748) */		BotState              *m_currentState;											// Executed when variable 'm_isAttacking' is false.
does this mean the official CS bot uses a finite state-machine design with each state wrapped in a class?
  
Reply With Quote