diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/server/tf2/info_buildpoint.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/server/tf2/info_buildpoint.h')
| -rw-r--r-- | game/server/tf2/info_buildpoint.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/game/server/tf2/info_buildpoint.h b/game/server/tf2/info_buildpoint.h new file mode 100644 index 0000000..294eee4 --- /dev/null +++ b/game/server/tf2/info_buildpoint.h @@ -0,0 +1,76 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Map entity that allows players to build objects on it +// +//=============================================================================// + +#ifndef INFO_BUILDPOINT_H +#define INFO_BUILDPOINT_H +#ifdef _WIN32 +#pragma once +#endif + +#include "ihasbuildpoints.h" + +//----------------------------------------------------------------------------- +// Purpose: Map entity that allows players to build objects on it +//----------------------------------------------------------------------------- +class CInfoBuildPoint : public CBaseEntity, public IHasBuildPoints +{ + DECLARE_CLASS( CInfoBuildPoint, CBaseEntity ); +public: + DECLARE_DATADESC(); + + void Spawn( void ); + void UpdateOnRemove( void ); + +// IHasBuildPoints +public: + // Tell me how many build points you have + virtual int GetNumBuildPoints( void ) const; + + // Give me the origin & angles of the specified build point + virtual bool GetBuildPoint( int iPoint, Vector &vecOrigin, QAngle &vecAngles ); + + virtual int GetBuildPointAttachmentIndex( int iPoint ) const; + + // Can I build the specified object on the specified build point? + virtual bool CanBuildObjectOnBuildPoint( int iPoint, int iObjectType ); + + // I've finished building the specified object on the specified build point + virtual void SetObjectOnBuildPoint( int iPoint, CBaseObject *pObject ); + + // Get the number of objects build on this entity + virtual int GetNumObjectsOnMe( void ); + + // Get the first object that's built on me + virtual CBaseEntity *GetFirstObjectOnMe( void ); + + // Get the first object of type, return NULL if no such type available + virtual CBaseObject *GetObjectOfTypeOnMe( int iObjectType ); + + // Remove all objects built on me + virtual void RemoveAllObjects( void ); + + // Return the maximum distance that this entity's build points can be snapped to + virtual float GetMaxSnapDistance( int iPoint ); + + // Return true if it's possible that build points on this entity may move in local space (i.e. due to animation) + virtual bool ShouldCheckForMovement( void ); + + // I've finished building the specified object on the specified build point + virtual int FindObjectOnBuildPoint( CBaseObject *pObject ); + + // Returns an exit point for a vehicle built on a build point... + virtual void GetExitPoint( CBaseEntity *pPlayer, int iPoint, Vector *pAbsOrigin, QAngle *pAbsAngles ); + + +private: + string_t m_iszAllowedObject; + int m_iAllowedObjectType; + CHandle<CBaseObject> m_hObjectBuiltOnMe; +}; + +extern CUtlVector<CInfoBuildPoint*> g_MapDefinedBuildPoints; + +#endif // INFO_BUILDPOINT_H |