/* -----------------------------------------------------------------------------
	GSFramework
	Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
----------------------------------------------------------------------------- */


#ifndef	__NMTRIGGER__
#define	__NMTRIGGER__


		#include "scene3d/mitem.h"
		#include "core/trigger.h"


namespace GS {
	namespace S3D {
		struct MTrigger;

/// Managed trigger proxy item.
class	MTriggerProxy : public Core::Trigger
{
		MTrigger	*mtrigger;

public:

virtual	void		MarkItem(Core::Item *);
virtual	void		DropItem(Core::Item *);

		MTriggerProxy(MTrigger *t) : mtrigger(t) {}
};

/*!
	@short	Managed trigger.
	@author Emmanuel Julien (ejulien@gsworks.fr)
*/
struct	MTrigger : public MItem, public MTriggerProxy
{
static	MItemType	GetMItemClassType() { return Type_Trigger; }

virtual	Core::Item	*GetBaseItem() { return this; }
virtual	Core::Renderable *GetRenderable() { return 0; }

virtual	bool		FromMetaTag(NML::Tag &);
virtual	NML::Tag	*AsMetaTag();

		MTrigger();
};

	} // S3D
} // GS


#endif // __NMTRIGGER__
