summaryrefslogtreecommitdiff
path: root/game/shared/tf2/tf_obj_basedrivergun_shared.h
blob: 3d79cd1c8aa0e3cd17b8a69d990cb36fe99d2c87 (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
61
62
63
64
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Base class for object upgrading objects
//
//=============================================================================//

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

#if defined( CLIENT_DLL )
#define CBaseObjectDriverGun C_BaseObjectDriverGun
#endif

#include "tf_obj_baseupgrade_shared.h"

// ------------------------------------------------------------------------ 
// Base class for objects that, when built on a vehicle, become under control of the driver
// ------------------------------------------------------------------------ 
class CBaseObjectDriverGun : public CBaseObjectUpgrade
{
DECLARE_CLASS( CBaseObjectDriverGun, CBaseObjectUpgrade );

public:
	DECLARE_NETWORKCLASS();
	DECLARE_PREDICTABLE();

	CBaseObjectDriverGun();

	virtual void	Spawn( void );
	virtual void	FinishedBuilding( void );

	// Firing
	virtual bool	CanFireNow( void ) { return false; }
	virtual void	Fire( CBaseTFPlayer *pDriver ) { return; }

	// Turning
	virtual void			SetTargetAngles( const QAngle &vecAngles );
	virtual const QAngle	&GetCurrentAngles( void );
	virtual Vector			GetFireOrigin( void );

	// HUD
	virtual void			DrawHudElements( void ) { return; }

#ifdef CLIENT_DLL
	// All predicted weapons need to implement and return true
	virtual bool	IsPredicted( void ) const
	{ 
		return true;
	}

	virtual bool	ShouldPredict( void );
#endif

protected:
	CNetworkQAngle( m_vecGunAngles );

private:
	CBaseObjectDriverGun( const CBaseObjectDriverGun & ); // not defined, not accessible
};

#endif // TF_OBJ_BASEDRIVERGUN_H