summaryrefslogtreecommitdiff
path: root/game/server/portal/func_portal_detector.h
blob: 3a6e32580840ed21817632e3b17a992f979ce98b (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
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: A volume which fires an output when a portal is placed in it.
//
// $NoKeywords: $
//======================================================================================//

#ifndef _FUNC_PORTAL_DETECTOR_H_
#define _FUNC_PORTAL_DETECTOR_H_

#ifdef _WIN32
#pragma once
#endif

#include "cbase.h"

class CFuncPortalDetector : public CBaseEntity
{
public:
	DECLARE_CLASS( CFuncPortalDetector, CBaseEntity );

	// Overloads from base entity
	virtual void	Spawn( void );
	
	void OnActivate( void );

	// Inputs to flip functionality on and off
	void InputDisable( inputdata_t &inputdata );
	void InputEnable( inputdata_t &inputdata );
	void InputToggle( inputdata_t &inputdata );

	// misc public methods
	bool IsActive( void ) { return m_bActive; }	// is this area currently detecting portals
	int GetLinkageGroupID( void ) { return m_iLinkageGroupID; }

	COutputEvent m_OnStartTouchPortal1;
	COutputEvent m_OnStartTouchPortal2;
	COutputEvent m_OnStartTouchLinkedPortal;
	COutputEvent m_OnStartTouchBothLinkedPortals;

	DECLARE_DATADESC();

private:
	bool	m_bActive;			// are we currently detecting portals
	int		m_iLinkageGroupID;	// what set of portals are we testing for?
	
};

#endif