//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//=============================================================================//

#include "cbase.h"
#include "hl2wars/rts_shareddefs.h"
#include "hl2wars/c_rts_mouse_brush.h"
//#include "hl2wars/hud_iconsvisuals.h"
#include "hl2wars/c_rts_globalresource.h"

// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
class C_OrderRTSTrigger : public C_MouseRTSBrush
{
public:
	DECLARE_CLASS( C_OrderRTSTrigger, C_MouseRTSBrush );

	DECLARE_CLIENTCLASS();
	//DECLARE_PREDICTABLE();

	C_OrderRTSTrigger() {};
	~C_OrderRTSTrigger() {};

	//void Spawn( void );

	virtual void	OnCursorEntered();

	virtual int GetBrushType( void ) { return MOUSEBRUSH_ORDER; };

	virtual color32 GetColor();

private:
	EHANDLE m_hOwner;
};

IMPLEMENT_CLIENTCLASS_DT(C_OrderRTSTrigger, DT_OrderRTSTrigger, COrderRTSTrigger)
	RecvPropEHandle	( RECVINFO( m_hOwner)),
END_RECV_TABLE()

void C_OrderRTSTrigger::OnCursorEntered()
{
	if( !IsSelected() )
		SetDrawSelection( true );
}

color32 C_OrderRTSTrigger::GetColor()
{
	if( m_hOwner )
	{
		Vector vecColor = g_RTSR->GetColor255( m_hOwner.Get()->GetTeamNumber() );
		color32 color = { vecColor.x, vecColor.y, vecColor.z, 200 };
		return color;
		/*C_CapturePoint *pCapPoint = dynamic_cast<C_CapturePoint *>(m_hOwner.Get());
		if( pCapPoint )
		{
			Vector vecColor = g_RTSR->GetColor255( pCapPoint->GetOwnerShip() );
			color32 color = { vecColor.x, vecColor.y, vecColor.z, 200 };
			return color;
		}*/
	}

	// default to gray
	color32 color2 = { 150, 150, 150, 200 };
	return color2;
}