blob: 0aa68e2b467c3c4e0a33444cf3fc6c62ee4dd051 (
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Order handling
//
// $NoKeywords: $
//=============================================================================//
#ifndef ORDERS_H
#define ORDERS_H
#ifdef _WIN32
#pragma once
#endif
class CTFTeam;
class CBaseTFPlayer;
#include "order_events.h"
//-----------------------------------------------------------------------------
// Purpose: Datatable container class for orders
//-----------------------------------------------------------------------------
class COrder : public CBaseEntity
{
DECLARE_CLASS( COrder, CBaseEntity );
public:
DECLARE_SERVERCLASS();
COrder();
virtual void UpdateOnRemove( void );
virtual int UpdateTransmitState() { return SetTransmitState( FL_EDICT_FULLCHECK ); }
virtual int ShouldTransmit( const CCheckTransmitInfo *pInfo );
// This is called when removing the order.
void DetachFromPlayer();
// Overridables.
public:
// Purpose: for updates on the order. Return true if the order should be removed.
virtual bool Update( void );
virtual bool UpdateOnEvent( COrderEvent_Base *pEvent );
public:
CBaseTFPlayer *GetOwner( void );
CBaseEntity *GetTargetEntity( void );
int GetType( void );
void SetOwner( CBaseTFPlayer *pPlayer );
void SetType( int iOrderType );
void SetTarget( CBaseEntity *pTarget );
void SetDistance( float flDistance );
void SetLifetime( float flLifetime );
public:
// Sent via datatable
CNetworkVar( int, m_iOrderType );
float m_flDistanceToRemove;
// When the order goes away.
double m_flDieTime;
// Personal order owner
CHandle< CBaseTFPlayer > m_hOwningPlayer;
EHANDLE m_hTarget;
CNetworkVar( int, m_iTargetEntIndex );
};
//-----------------------------------------------------------------------------
// ORDER CREATION DATA
//-----------------------------------------------------------------------------
// Time between personal order updates
#define PERSONAL_ORDER_UPDATE_TIME 2.0
// KILL orders
#define ORDER_KILL_ENEMY_DISTANCE 2048 // Distance the enemy must be within for this player to receive this order
// HEAL orders
#define ORDER_HEAL_FRIENDLY_DISTANCE 2048 // Distance the friendly must be within this player to receive this order
#endif // ORDERS_H
|