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.

82 lines
2.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef EXTRA_MAP_ENTITY_H
  7. #define EXTRA_MAP_ENTITY_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "baseanimating.h"
  12. #define ENTITYROCKET_DEFAULT_MODEL "models/props_skybox/grocket_001.mdl"
  13. #define ENTITYCARRIER_DEFAULT_MODEL "models/props_skybox/skybox_carrier.mdl"
  14. #define ENTITYSIGN_DEFAULT_MODEL "models/props_teaser/update_billboard001.mdl"
  15. #define ENTITYSAUCER_DEFAULT_MODEL "models/props_teaser/saucer.mdl"
  16. DECLARE_AUTO_LIST( IExtraMapEntityAutoList );
  17. class CExtraMapEntity : public CBaseAnimating, public IExtraMapEntityAutoList
  18. {
  19. DECLARE_CLASS( CExtraMapEntity, CBaseAnimating );
  20. public:
  21. DECLARE_DATADESC();
  22. virtual void Spawn( void ) OVERRIDE;
  23. virtual void Precache( void ) OVERRIDE;
  24. virtual const char *GetDefaultModel( void ) = 0;
  25. virtual void PrepareModelName( const char *szModelName );
  26. static void SpawnExtraModel( void );
  27. virtual bool ShouldAnimate( void ){ return false; }
  28. void AnimThink( void );
  29. protected:
  30. virtual void Precache_Internal( void );
  31. private:
  32. static const char *ValidateKeyName( const char *pszEntName );
  33. };
  34. class CExtraMapEntity_Rocket : public CExtraMapEntity
  35. {
  36. DECLARE_CLASS( CExtraMapEntity_Rocket, CExtraMapEntity );
  37. public:
  38. virtual void Spawn( void ) OVERRIDE;
  39. virtual const char *GetDefaultModel( void ) OVERRIDE { return ENTITYROCKET_DEFAULT_MODEL; }
  40. protected:
  41. virtual void Precache_Internal( void ) OVERRIDE;
  42. };
  43. class CExtraMapEntity_Carrier : public CExtraMapEntity
  44. {
  45. DECLARE_CLASS( CExtraMapEntity_Carrier, CExtraMapEntity );
  46. public:
  47. virtual void Spawn( void ) OVERRIDE;
  48. virtual const char *GetDefaultModel( void ) OVERRIDE { return ENTITYCARRIER_DEFAULT_MODEL; }
  49. };
  50. class CExtraMapEntity_Sign : public CExtraMapEntity
  51. {
  52. DECLARE_CLASS( CExtraMapEntity_Sign, CExtraMapEntity );
  53. public:
  54. virtual void Spawn( void ) OVERRIDE;
  55. virtual const char *GetDefaultModel( void ) OVERRIDE { return ENTITYSIGN_DEFAULT_MODEL; }
  56. };
  57. class CExtraMapEntity_Saucer : public CExtraMapEntity
  58. {
  59. DECLARE_CLASS( CExtraMapEntity_Saucer, CExtraMapEntity );
  60. public:
  61. virtual void Spawn( void ) OVERRIDE;
  62. virtual const char *GetDefaultModel( void ) OVERRIDE{ return ENTITYSAUCER_DEFAULT_MODEL; }
  63. virtual bool ShouldAnimate( void ){ return true; }
  64. };
  65. #endif // EXTRA_MAP_ENTITY_H