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.

87 lines
2.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef C_SDK_PLAYER_H
  7. #define C_SDK_PLAYER_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "sdk_playeranimstate.h"
  12. #include "c_baseplayer.h"
  13. #include "sdk_shareddefs.h"
  14. #include "baseparticleentity.h"
  15. class C_SDKPlayer : public C_BasePlayer, public ISDKPlayerAnimStateHelpers
  16. {
  17. public:
  18. DECLARE_CLASS( C_SDKPlayer, C_BasePlayer );
  19. DECLARE_CLIENTCLASS();
  20. DECLARE_PREDICTABLE();
  21. DECLARE_INTERPOLATION();
  22. C_SDKPlayer();
  23. ~C_SDKPlayer();
  24. static C_SDKPlayer* GetLocalSDKPlayer();
  25. virtual const QAngle& GetRenderAngles();
  26. virtual void UpdateClientSideAnimation();
  27. virtual void PostDataUpdate( DataUpdateType_t updateType );
  28. virtual void OnDataChanged( DataUpdateType_t updateType );
  29. // Called by shared code.
  30. public:
  31. // ISDKPlayerAnimState overrides.
  32. virtual CWeaponSDKBase* SDKAnim_GetActiveWeapon();
  33. virtual bool SDKAnim_CanMove();
  34. void DoAnimationEvent( PlayerAnimEvent_t event, int nData = 0 );
  35. bool ShouldDraw();
  36. ISDKPlayerAnimState *m_PlayerAnimState;
  37. QAngle m_angEyeAngles;
  38. CInterpolatedVar< QAngle > m_iv_angEyeAngles;
  39. CNetworkVar( int, m_iThrowGrenadeCounter ); // used to trigger grenade throw animations.
  40. CNetworkVar( int, m_iShotsFired ); // number of shots fired recently
  41. EHANDLE m_hRagdoll;
  42. CWeaponSDKBase *GetActiveSDKWeapon() const;
  43. C_BaseAnimating *BecomeRagdollOnClient();
  44. IRagdoll* C_SDKPlayer::GetRepresentativeRagdoll() const;
  45. void FireBullet(
  46. Vector vecSrc,
  47. const QAngle &shootAngles,
  48. float vecSpread,
  49. int iDamage,
  50. int iBulletType,
  51. CBaseEntity *pevAttacker,
  52. bool bDoEffects,
  53. float x,
  54. float y );
  55. private:
  56. C_SDKPlayer( const C_SDKPlayer & );
  57. };
  58. inline C_SDKPlayer* ToSDKPlayer( CBaseEntity *pPlayer )
  59. {
  60. Assert( dynamic_cast< C_SDKPlayer* >( pPlayer ) != NULL );
  61. return static_cast< C_SDKPlayer* >( pPlayer );
  62. }
  63. #endif // C_SDK_PLAYER_H