Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef IHASBUILDPOINTS_H
  7. #define IHASBUILDPOINTS_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. class CBaseObject;
  12. // Derive from this interface if your entity can have objects placed on build points on it
  13. class IHasBuildPoints
  14. {
  15. public:
  16. // Tell me how many build points you have
  17. virtual int GetNumBuildPoints( void ) const = 0;
  18. // Give me the origin & angles of the specified build point
  19. virtual bool GetBuildPoint( int iPoint, Vector &vecOrigin, QAngle &vecAngles ) = 0;
  20. // If the build point wants to parent built objects to an attachment point on the entity,
  21. // it'll return a value >= 1 here specifying which attachment to sit on.
  22. virtual int GetBuildPointAttachmentIndex( int iPoint ) const = 0;
  23. // Can I build the specified object on the specified build point?
  24. virtual bool CanBuildObjectOnBuildPoint( int iPoint, int iObjectType ) = 0;
  25. // I've finished building the specified object on the specified build point
  26. virtual void SetObjectOnBuildPoint( int iPoint, CBaseObject *pObject ) = 0;
  27. // Get the number of objects build on this entity
  28. virtual int GetNumObjectsOnMe( void ) = 0;
  29. // Get the first object of type, return NULL if no such type available
  30. virtual CBaseObject *GetObjectOfTypeOnMe( int iObjectType ) = 0;
  31. // Remove all objects built on me
  32. virtual void RemoveAllObjects( void ) = 0;
  33. // Return the maximum distance that this entity's build points can be snapped to
  34. virtual float GetMaxSnapDistance( int iPoint ) = 0;
  35. // Return true if it's possible that build points on this entity may move in local space (i.e. due to animation)
  36. virtual bool ShouldCheckForMovement( void ) = 0;
  37. // I've finished building the specified object on the specified build point
  38. virtual int FindObjectOnBuildPoint( CBaseObject *pObject ) = 0;
  39. };
  40. #endif // IHASBUILDPOINTS_H