summaryrefslogtreecommitdiff
path: root/game/server/tf2/resource_chunk.h
blob: 7f0327820524747a0e2340a5bc0123c26577389b (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
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//=============================================================================//

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


#include "props.h"

class CResourceZone;

extern ConVar	resource_chunk_value;
extern ConVar	resource_chunk_processed_value;

//-----------------------------------------------------------------------------
// Purpose: A resource chunk that's harvestable by a player
//-----------------------------------------------------------------------------
class CResourceChunk : public CBaseProp
{
	DECLARE_CLASS( CResourceChunk, CBaseProp );
public:
	DECLARE_DATADESC();
	DECLARE_SERVERCLASS();

	virtual void	Spawn( void );
	virtual void	Precache( void );
	virtual void	UpdateOnRemove( void );

	void			ChunkTouch( CBaseEntity *pOther );
	void			ChunkRemove( void );

	virtual bool	IsStandable( const CBaseEntity *pStander ) { return true; } // can pStander stand on this entity?
	virtual bool	IsProcessed( void ) { return m_bIsProcessed; };

	float			GetResourceValue( void );

	static CResourceChunk *Create( bool bProcessed, const Vector &vecOrigin, const Vector &vecVelocity );

public:
	CHandle<CResourceZone>	m_hZone;
	bool				m_bIsProcessed;
	bool				m_bBeingCollected;
};

#endif // RESOURCE_CHUNK_H