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.

85 lines
2.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: CTF Spawn Point.
  4. //
  5. //=============================================================================//
  6. #ifndef ENTITY_TFSTART_H
  7. #define ENTITY_TFSTART_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. class CTeamControlPoint;
  12. class CTeamControlPointRound;
  13. //=============================================================================
  14. //
  15. // TF team spawning entity.
  16. //
  17. enum PlayerTeamSpawnMode_t
  18. {
  19. PlayerTeamSpawnMode_Normal = 0,
  20. PlayerTeamSpawnMode_Triggered = 1,
  21. };
  22. enum PlayerTeamSpawn_MatchSummary_t
  23. {
  24. PlayerTeamSpawn_MatchSummary_None = 0,
  25. PlayerTeamSpawn_MatchSummary_Loser = 1,
  26. PlayerTeamSpawn_MatchSummary_Winner = 2,
  27. };
  28. DECLARE_AUTO_LIST( ITFTeamSpawnAutoList );
  29. class CTFTeamSpawn : public CPointEntity, public ITFTeamSpawnAutoList
  30. {
  31. public:
  32. DECLARE_CLASS( CTFTeamSpawn, CPointEntity );
  33. CTFTeamSpawn();
  34. void Activate( void );
  35. bool IsDisabled( void ) { return m_bDisabled; }
  36. void SetDisabled( bool bDisabled ) { m_bDisabled = bDisabled; }
  37. PlayerTeamSpawnMode_t GetTeamSpawnMode( void ) { return m_nSpawnMode; }
  38. // Inputs/Outputs.
  39. void InputEnable( inputdata_t &inputdata );
  40. void InputDisable( inputdata_t &inputdata );
  41. void InputRoundSpawn( inputdata_t &inputdata );
  42. int DrawDebugTextOverlays(void);
  43. CHandle<CTeamControlPoint> GetControlPoint( void ) { return m_hControlPoint; }
  44. CHandle<CTeamControlPointRound> GetRoundBlueSpawn( void ) { return m_hRoundBlueSpawn; }
  45. CHandle<CTeamControlPointRound> GetRoundRedSpawn( void ) { return m_hRoundRedSpawn; }
  46. PlayerTeamSpawn_MatchSummary_t GetMatchSummaryType( void ){ return m_nMatchSummaryType; }
  47. bool AlreadyUsedForMatchSummary( void ){ return m_bAlreadyUsedForMatchSummary; }
  48. void SetAlreadyUsedForMatchSummary( void ){ m_bAlreadyUsedForMatchSummary = true; }
  49. private:
  50. bool m_bDisabled; // Enabled/Disabled?
  51. PlayerTeamSpawnMode_t m_nSpawnMode; // How are players allowed to spawn here?
  52. string_t m_iszControlPointName;
  53. string_t m_iszRoundBlueSpawn;
  54. string_t m_iszRoundRedSpawn;
  55. CHandle<CTeamControlPoint> m_hControlPoint;
  56. CHandle<CTeamControlPointRound> m_hRoundBlueSpawn;
  57. CHandle<CTeamControlPointRound> m_hRoundRedSpawn;
  58. PlayerTeamSpawn_MatchSummary_t m_nMatchSummaryType; // is this a spawn location for a match summary?
  59. bool m_bAlreadyUsedForMatchSummary;
  60. DECLARE_DATADESC();
  61. };
  62. #endif // ENTITY_TFSTART_H