summaryrefslogtreecommitdiff
path: root/game/server/tf2/tf_shield_flat.h
blob: c107db4d855179f06751d50ceccd26898f3746dd (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
65
66
67
68
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//=============================================================================//

#ifndef TF_SHIELD_FLAT_H
#define TF_SHIELD_FLAT_H

#ifdef _WIN32
#pragma once
#endif

#include "tf_shield.h"
#include "mathlib/vector.h"

//-----------------------------------------------------------------------------
//
// This is the shield projected by the grenade
//
//-----------------------------------------------------------------------------

class CShieldFlat : public CShield
{
	DECLARE_CLASS( CShieldFlat, CShield );
	DECLARE_SERVERCLASS();

public:
	void SetSize( float w, float h );

	virtual void	Spawn( void );

	virtual void	SetEMPed( bool isEmped );

	void Activate( bool active );

	virtual int Width() { return 2; }
	virtual int Height() { return 2; }
	virtual bool IsPanelActive( int x, int y ) { return true; }
	virtual const Vector& GetPoint( int x, int y );
	virtual void ComputeWorldSpaceSurroundingBox( Vector *pWorldMins, Vector *pWorldMaxs );

public:
	// Think methods
	void ShieldMoved();

public:
	
	// networked data
	CNetworkVar( unsigned char, m_ShieldState );
	CNetworkVar( float, m_Width );
	CNetworkVar( float, m_Height );

private:
	QAngle	m_LastAngles;
	Vector	m_LastPosition;
	Vector	m_Pos[4];
};


//-----------------------------------------------------------------------------
// Purpose: Create a mobile version of the shield
//-----------------------------------------------------------------------------

CShieldFlat* CreateFlatShield( CBaseEntity *pOwner, float w, float h, const Vector& relOrigin, const QAngle &relAngles );

#endif TF_SHIELD_FLAT_H