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.

94 lines
2.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef C_OBJ_DISPENSER_H
  8. #define C_OBJ_DISPENSER_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "c_baseobject.h"
  13. #include "ObjectControlPanel.h"
  14. #include "vgui_controls/RotatingProgressBar.h"
  15. class C_ObjectDispenser : public C_BaseObject
  16. {
  17. DECLARE_CLASS( C_ObjectDispenser, C_BaseObject );
  18. public:
  19. DECLARE_CLIENTCLASS();
  20. C_ObjectDispenser();
  21. ~C_ObjectDispenser();
  22. int GetMetalAmmoCount() { return m_iAmmoMetal; }
  23. CUtlVector< CHandle<C_TFPlayer> > m_hHealingTargets;
  24. virtual void OnDataChanged( DataUpdateType_t updateType );
  25. virtual void ClientThink() OVERRIDE;
  26. virtual void SetInvisibilityLevel( float flValue );
  27. void UpdateEffects( void );
  28. void StopEffects( bool bRemoveAll = false );
  29. virtual void UpdateDamageEffects( BuildingDamageLevel_t damageLevel );
  30. virtual int GetMaxMetal( void );
  31. bool m_bUpdateHealingTargets;
  32. private:
  33. int m_iState;
  34. int m_iAmmoMetal;
  35. int m_iMiniBombCounter;
  36. bool m_bPlayingSound;
  37. struct healingtargeteffects_t
  38. {
  39. C_BaseEntity *pTarget;
  40. CNewParticleEffect *pEffect;
  41. };
  42. CUtlVector<healingtargeteffects_t> m_hHealingTargetEffects;
  43. C_ObjectDispenser( const C_ObjectDispenser & ); // not defined, not accessible
  44. };
  45. class CDispenserControlPanel : public CObjectControlPanel
  46. {
  47. DECLARE_CLASS( CDispenserControlPanel, CObjectControlPanel );
  48. public:
  49. CDispenserControlPanel( vgui::Panel *parent, const char *panelName );
  50. protected:
  51. virtual void OnTickActive( C_BaseObject *pObj, C_TFPlayer *pLocalPlayer );
  52. virtual bool IsVisible() OVERRIDE;
  53. private:
  54. vgui::RotatingProgressBar *m_pAmmoProgress;
  55. CHandle< C_ObjectDispenser > m_hDispenser;
  56. };
  57. class CDispenserControlPanel_Red : public CDispenserControlPanel
  58. {
  59. DECLARE_CLASS( CDispenserControlPanel_Red, CDispenserControlPanel );
  60. public:
  61. CDispenserControlPanel_Red( vgui::Panel *parent, const char *panelName ) : CDispenserControlPanel( parent, panelName ) {}
  62. };
  63. class C_ObjectCartDispenser : public C_ObjectDispenser
  64. {
  65. DECLARE_CLASS( C_ObjectCartDispenser, C_ObjectDispenser );
  66. public:
  67. DECLARE_CLIENTCLASS();
  68. };
  69. #endif //C_OBJ_DISPENSER_H