/**
*
* \file AVP_ServerEntity_InterationTrigger.h
*
* Created by Chris Wallace
*
* Copyright (C) 2007 Rebellion, All Rights Reserved.
*
**/

#ifdef ASURA_USE_PRAGMA_ONCE
	#pragma once
#endif

#ifndef __AVP_SERVERENTITY_INTERACTIONTRIGGER_H__
#define __AVP_SERVERENTITY_INTERACTIONTRIGGER_H__

/************/
/* Includes.*/
/************/

#include "Entity/AVP_Entity_Classification.h"
#include "Entity/Triggers/Asura_ServerEntity_AdvancedVolumeTrigger.h"

class AVP_ServerEntity_InteractionTrigger : public Asura_ServerEntity_AdvancedVolumeTrigger
{
public:
	enum AVP_INTERACTIONTRIGGEREDBY_TYPES
	   {
		   AVP_ITBT_SPECIFICGUID	= 0,
		   AVP_ITBT_ALIENS,
		   AVP_ITBT_HUMANS,
		   AVP_ITBT_PREDATORS,

		   NUM_AVP_INTERACTIONTRIGGEREDBY_TYPES
	   };

	static  AVP_ServerEntity_InteractionTrigger* Create( Asura_Guid uGUID) { return new AVP_ServerEntity_InteractionTrigger (uGUID); }

	virtual bool HandleMessage(const Asura_Message* pxMessage);
    virtual void MakeClientUpdateMessage();
	virtual bool IsVolumeOccupied();
	#ifdef ASURA_TOOLS
		virtual bool CanBeIncludedInTemplate() const {return Classification == AVP_ENTITYCLASS_INTERACTIONTRIGGER;}
	#endif //ASURA_TOOLS

	int GetListFlags(void) const { return(m_iListFlags); }

	// Return function for the new list (put in for the shot dynamite triggering)
	static const Asura_Hashed_List<AVP_ServerEntity_InteractionTrigger>* GetList() { return &s_xList; }
	static AVP_ServerEntity_InteractionTrigger* FindEntity(Asura_Guid uGuid) { return s_xList.FindEntity(uGuid); }
	
	virtual	void ReadFromChunkStream		(Asura_Chunk_Stream& xStream);
	virtual	void WriteToChunkStream			(Asura_Chunk_Stream& xStream) const;
	
protected:

	AVP_ServerEntity_InteractionTrigger(Asura_Guid uGuid);
	virtual ~AVP_ServerEntity_InteractionTrigger();

	virtual bool IsTriggered(void);
	virtual bool IsUnTriggered(void);

	virtual	bool IsFilledFromChunkBuffer		(void) const					{ return (false); }

private:
	static Asura_Hashed_List<AVP_ServerEntity_InteractionTrigger> s_xList;
	typedef Asura_ServerEntity_AdvancedVolumeTrigger ASURA_PARENT;

	Asura_Guid m_uTriggeredByGuid;

	typedef Asura_ServerEntity_AdvancedVolumeTrigger PARENT;


#ifdef ASURA_TOOLS
	static const char* s_aszAVPVolumeTypes[NUM_AVP_INTERACTIONTRIGGEREDBY_TYPES];
#endif
	friend class ToolsAVP_Entity_InteractionTrigger;
};

#endif//__AVP_SERVERENTITY_INTERACTIONTRIGGER_H__
