diff options
| author | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:31:46 -0800 |
|---|---|---|
| committer | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:46:31 -0800 |
| commit | f56bb35301836e56582a575a75864392a0177875 (patch) | |
| tree | de61ddd39de3e7df52759711950b4c288592f0dc /sp/src/game/server/AI_Interest_Target.h | |
| parent | Mark some more files as text. (diff) | |
| download | source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip | |
Fix line endings. WHAMMY.
Diffstat (limited to 'sp/src/game/server/AI_Interest_Target.h')
| -rw-r--r-- | sp/src/game/server/AI_Interest_Target.h | 176 |
1 files changed, 88 insertions, 88 deletions
diff --git a/sp/src/game/server/AI_Interest_Target.h b/sp/src/game/server/AI_Interest_Target.h index 420f51c4..dd4cfe30 100644 --- a/sp/src/game/server/AI_Interest_Target.h +++ b/sp/src/game/server/AI_Interest_Target.h @@ -1,88 +1,88 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose: Hooks and classes for the support of humanoid NPCs with
-// groovy facial animation capabilities, aka, "Actors"
-//
-//=============================================================================//
-
-#ifndef AI_INTEREST_TARGET_H
-#define AI_INTEREST_TARGET_H
-
-#if defined( _WIN32 )
-#pragma once
-#endif
-
-
-//-----------------------------------------------------------------------------
-// CAI_BaseActor
-//
-// Purpose: The base class for all facially expressive NPCS.
-//
-//-----------------------------------------------------------------------------
-
-class CAI_InterestTarget_t
-{
-public:
- enum CAI_InterestTarget_e
- {
- LOOKAT_ENTITY = 0,
- LOOKAT_POSITION,
- LOOKAT_BOTH
- };
-
-public:
- bool IsThis( CBaseEntity *pThis );
- const Vector &GetPosition( void );
- bool IsActive( void );
- float Interest( void );
-
-public:
- CAI_InterestTarget_e m_eType; // ????
-
- EHANDLE m_hTarget;
- Vector m_vecPosition;
- float m_flStartTime;
- float m_flEndTime;
- float m_flRamp;
- float m_flInterest;
-
- DECLARE_SIMPLE_DATADESC();
-};
-
-
-class CAI_InterestTarget : public CUtlVector<CAI_InterestTarget_t>
-{
-public:
- void Add( CBaseEntity *pTarget, float flImportance, float flDuration, float flRamp );
- void Add( const Vector &vecPosition, float flImportance, float flDuration, float flRamp );
- void Add( CBaseEntity *pTarget, const Vector &vecPosition, float flImportance, float flDuration, float flRamp );
- int Find( CBaseEntity *pTarget )
- {
- int i;
- for ( i = 0; i < Count(); i++)
- {
- if (pTarget == (*this)[i].m_hTarget)
- return i;
- }
- return InvalidIndex();
- }
-
- void Cleanup( void )
- {
- int i;
- for (i = Count() - 1; i >= 0; i--)
- {
- if (!Element(i).IsActive())
- {
- Remove( i );
- }
- }
- };
-
-private:
- void Add( CAI_InterestTarget_t::CAI_InterestTarget_e type, CBaseEntity *pTarget, const Vector &vecPosition, float flImportance, float flDuration, float flRamp );
-};
-
-
-//-----------------------------------------------------------------------------
-#endif // AI_INTEREST_TARGET_H
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Hooks and classes for the support of humanoid NPCs with +// groovy facial animation capabilities, aka, "Actors" +// +//=============================================================================// + +#ifndef AI_INTEREST_TARGET_H +#define AI_INTEREST_TARGET_H + +#if defined( _WIN32 ) +#pragma once +#endif + + +//----------------------------------------------------------------------------- +// CAI_BaseActor +// +// Purpose: The base class for all facially expressive NPCS. +// +//----------------------------------------------------------------------------- + +class CAI_InterestTarget_t +{ +public: + enum CAI_InterestTarget_e + { + LOOKAT_ENTITY = 0, + LOOKAT_POSITION, + LOOKAT_BOTH + }; + +public: + bool IsThis( CBaseEntity *pThis ); + const Vector &GetPosition( void ); + bool IsActive( void ); + float Interest( void ); + +public: + CAI_InterestTarget_e m_eType; // ???? + + EHANDLE m_hTarget; + Vector m_vecPosition; + float m_flStartTime; + float m_flEndTime; + float m_flRamp; + float m_flInterest; + + DECLARE_SIMPLE_DATADESC(); +}; + + +class CAI_InterestTarget : public CUtlVector<CAI_InterestTarget_t> +{ +public: + void Add( CBaseEntity *pTarget, float flImportance, float flDuration, float flRamp ); + void Add( const Vector &vecPosition, float flImportance, float flDuration, float flRamp ); + void Add( CBaseEntity *pTarget, const Vector &vecPosition, float flImportance, float flDuration, float flRamp ); + int Find( CBaseEntity *pTarget ) + { + int i; + for ( i = 0; i < Count(); i++) + { + if (pTarget == (*this)[i].m_hTarget) + return i; + } + return InvalidIndex(); + } + + void Cleanup( void ) + { + int i; + for (i = Count() - 1; i >= 0; i--) + { + if (!Element(i).IsActive()) + { + Remove( i ); + } + } + }; + +private: + void Add( CAI_InterestTarget_t::CAI_InterestTarget_e type, CBaseEntity *pTarget, const Vector &vecPosition, float flImportance, float flDuration, float flRamp ); +}; + + +//----------------------------------------------------------------------------- +#endif // AI_INTEREST_TARGET_H |