summaryrefslogtreecommitdiff
path: root/game/server/tf/tf_extra_map_entity.h
blob: ac2ccc8b371850a9f5aa5349babf34f0b6867191 (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
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
//=============================================================================//
#ifndef EXTRA_MAP_ENTITY_H
#define EXTRA_MAP_ENTITY_H

#ifdef _WIN32
#pragma once
#endif

#include "baseanimating.h"

#define ENTITYROCKET_DEFAULT_MODEL	"models/props_skybox/grocket_001.mdl"
#define ENTITYCARRIER_DEFAULT_MODEL	"models/props_skybox/skybox_carrier.mdl"
#define ENTITYSIGN_DEFAULT_MODEL	"models/props_teaser/update_billboard001.mdl"
#define ENTITYSAUCER_DEFAULT_MODEL	"models/props_teaser/saucer.mdl"

DECLARE_AUTO_LIST( IExtraMapEntityAutoList );
class CExtraMapEntity : public CBaseAnimating, public IExtraMapEntityAutoList
{
	DECLARE_CLASS( CExtraMapEntity, CBaseAnimating );
public:
	DECLARE_DATADESC();

	virtual void	Spawn( void ) OVERRIDE;
	virtual void	Precache( void ) OVERRIDE;
	virtual const char *GetDefaultModel( void ) = 0;
	virtual void	PrepareModelName( const char *szModelName );

	static void		SpawnExtraModel( void );

	virtual bool	ShouldAnimate( void ){ return false; }
	void			AnimThink( void );

protected:
	virtual void	Precache_Internal( void );

private:
	static const char *ValidateKeyName( const char *pszEntName );
};

class CExtraMapEntity_Rocket : public CExtraMapEntity
{
	DECLARE_CLASS( CExtraMapEntity_Rocket, CExtraMapEntity );
public:
	virtual void	Spawn( void ) OVERRIDE;
	virtual const char *GetDefaultModel( void ) OVERRIDE { return ENTITYROCKET_DEFAULT_MODEL; }

protected:
	virtual void	Precache_Internal( void ) OVERRIDE;
};

class CExtraMapEntity_Carrier : public CExtraMapEntity
{
	DECLARE_CLASS( CExtraMapEntity_Carrier, CExtraMapEntity );
public:
	virtual void	Spawn( void ) OVERRIDE;
	virtual const char *GetDefaultModel( void ) OVERRIDE { return ENTITYCARRIER_DEFAULT_MODEL; }
};

class CExtraMapEntity_Sign : public CExtraMapEntity
{
	DECLARE_CLASS( CExtraMapEntity_Sign, CExtraMapEntity );
public:
	virtual void	Spawn( void ) OVERRIDE;
	virtual const char *GetDefaultModel( void ) OVERRIDE { return ENTITYSIGN_DEFAULT_MODEL; }
};

class CExtraMapEntity_Saucer : public CExtraMapEntity
{
	DECLARE_CLASS( CExtraMapEntity_Saucer, CExtraMapEntity );
public:
	virtual void	Spawn( void ) OVERRIDE;
	virtual const char *GetDefaultModel( void ) OVERRIDE{ return ENTITYSAUCER_DEFAULT_MODEL; }
	virtual bool	ShouldAnimate( void ){ return true; }
};

#endif // EXTRA_MAP_ENTITY_H