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.

70 lines
2.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef C_TF_PASSTIME_LOGIC_H
  8. #define C_TF_PASSTIME_LOGIC_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "c_baseentity.h"
  13. #include "c_tf_passtime_ball.h"
  14. #include "utlvector.h"
  15. //-----------------------------------------------------------------------------
  16. class C_LocalTempEntity;
  17. class C_TFPlayer;
  18. class C_PasstimeReticle;
  19. class C_TFPasstimeLogic : public C_BaseEntity
  20. {
  21. public:
  22. DECLARE_CLASS( C_TFPasstimeLogic, C_BaseEntity );
  23. DECLARE_CLIENTCLASS();
  24. C_TFPasstimeLogic();
  25. virtual ~C_TFPasstimeLogic();
  26. virtual void Spawn() OVERRIDE;
  27. virtual void ClientThink() OVERRIDE;
  28. virtual void PostDataUpdate( DataUpdateType_t updateType ) OVERRIDE;
  29. C_PasstimeBall *GetBall() const { return m_hBall.Get(); }
  30. void GetTrackPoints( Vector (&points)[16] );
  31. int GetNumSections() const { return m_iNumSections; }
  32. int GetCurrentSection() const { return m_iCurrentSection; }
  33. bool GetBallReticleTarget( C_BaseEntity **ppEnt, bool *bHomingActive ) const;
  34. bool BCanPlayerPickUpBall( C_TFPlayer *pPlayer ) const;
  35. float GetMaxPassRange() const { return m_flMaxPassRange; }
  36. int GetBallPower() const { return m_iBallPower; }
  37. private:
  38. bool GetImportantEntities( C_PasstimeBall **ppBall, C_TFPlayer **ppCarrier, C_TFPlayer **ppHomingTarget ) const;
  39. void DestroyBeam( int i, C_PasstimeBall *pBall );
  40. void DestroyBeams( C_PasstimeBall *pBall );
  41. void UpdateBeams();
  42. C_PasstimeReticle *m_pBallReticle;
  43. CUtlVector<C_PasstimeReticle*> m_pGoalReticles;
  44. C_PasstimeReticle *m_pPassReticle;
  45. CNewParticleEffect *m_apPackBeams[MAX_PLAYERS + 1];
  46. bool m_bPlayerIsPackMember[MAX_PLAYERS + 1];
  47. CNetworkHandle( C_PasstimeBall, m_hBall );
  48. CNetworkArray( Vector, m_trackPoints, 16 );
  49. CNetworkVar( int, m_iNumSections );
  50. CNetworkVar( int, m_iCurrentSection );
  51. CNetworkVar( float, m_flMaxPassRange );
  52. CNetworkVar( int, m_iBallPower );
  53. CNetworkVar( float, m_flPackSpeed );
  54. };
  55. //-----------------------------------------------------------------------------
  56. extern C_TFPasstimeLogic* g_pPasstimeLogic;
  57. #endif // C_TF_PASSTIME_LOGIC_H