summaryrefslogtreecommitdiff
path: root/game/server/tf2/tf_obj_resourcepump.h
blob: 83229fc9e290b574a3118d77956307eab45d7f95 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Resource pump
//
// $NoKeywords: $
//=============================================================================//

#ifndef TF_OBJ_RESOURCEPUMP_H
#define TF_OBJ_RESOURCEPUMP_H
#ifdef _WIN32
#pragma once
#endif


#include "tf_obj.h"


class CResourceZone;

// ------------------------------------------------------------------------ //
// Pump defines
#define RESOURCEPUMP_MINS			Vector(-20, -20, 0)
#define RESOURCEPUMP_MAXS			Vector( 20,  20, 140)

// ------------------------------------------------------------------------ //
// Resupply object that's built by the player
// ------------------------------------------------------------------------ //
class CObjectResourcePump : public CBaseObject
{
DECLARE_CLASS( CObjectResourcePump, CBaseObject );

public:
	DECLARE_DATADESC();
	DECLARE_SERVERCLASS();

	static CObjectResourcePump* Create(const Vector &vOrigin, const QAngle &vAngles);

	CObjectResourcePump();

	virtual void	Spawn();
	virtual void	Activate( void );
	virtual void	GetControlPanelInfo( int nPanelIndex, const char *&pPanelName );
	virtual void	FinishedBuilding( void );
	void			SetupPump( void );
	virtual void	Precache();
	virtual bool	CanTakeEMPDamage( void ) { return true; }

	virtual void	ResourcePumpThink( void );
	virtual bool	ClientCommand( CBaseTFPlayer *pPlayer, const CCommand &args );
	virtual void	SetupTeamModel( void );

	// Gets the resource zone (may be NULL!)
	CResourceZone* GetResourceZone();

private:
	float	m_flPumpSpeed;
	CNetworkVar( int, m_iPumpLevel );
};

#endif // TF_OBJ_RESOURCEPUMP_H