Counter Strike : Global Offensive Source Code
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.

80 lines
1.5 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef WEAPON_KNIFE_H
  7. #define WEAPON_KNIFE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "weapon_csbase.h"
  12. #if defined( CLIENT_DLL )
  13. #define CKnife C_Knife
  14. #define CKnifeGG C_KnifeGG
  15. #endif
  16. // ----------------------------------------------------------------------------- //
  17. // CKnife class definition.
  18. // ----------------------------------------------------------------------------- //
  19. class CKnife : public CWeaponCSBase
  20. {
  21. public:
  22. DECLARE_CLASS( CKnife, CWeaponCSBase );
  23. DECLARE_NETWORKCLASS();
  24. DECLARE_PREDICTABLE();
  25. CKnife();
  26. // We say yes to this so the weapon system lets us switch to it.
  27. virtual bool HasPrimaryAmmo();
  28. virtual bool CanBeSelected();
  29. virtual void Precache();
  30. void Spawn();
  31. bool SwingOrStab( CSWeaponMode weaponMode );
  32. void PrimaryAttack();
  33. void SecondaryAttack();
  34. void WeaponAnimation( int iAnimation );
  35. virtual bool Deploy();
  36. bool CanDrop();
  37. void WeaponIdle();
  38. virtual CSWeaponID GetCSWeaponID( void ) const { return WEAPON_KNIFE; }
  39. private:
  40. CKnife( const CKnife & ) {}
  41. #ifndef CLIENT_DLL
  42. bool m_swingLeft;
  43. #endif
  44. };
  45. class CKnifeGG : public CKnife
  46. {
  47. public:
  48. DECLARE_CLASS( CKnifeGG, CKnife );
  49. DECLARE_NETWORKCLASS();
  50. DECLARE_PREDICTABLE();
  51. virtual CSWeaponID GetCSWeaponID( void ) const { return WEAPON_KNIFE_GG; }
  52. };
  53. #endif // WEAPON_KNIFE_H