/// @file ToolKit.h
#ifndef TOOLKIT_H
#define TOOLKIT_H
#include "../core/process/Actor.h"
#include <vector>
using std::vector;

class ToolKit;
/**
	@brief Focus Evnet Interface

	ToolKit 객체가 Focus Event 가 발생했을때 대응하는 인터페이스
*/
class FocusEvent {
	public:
		FocusEvent(){}
		virtual ~FocusEvent(){}
		virtual void focus(ToolKit* _pToolKit) = 0;
};
/**
	@brief Act Evnet Interface

	ToolKit 객체가 Act Event 가 발생했을때 대응하는 인터페이스
*/
class ActEvent {
	public:
		ActEvent(){}
		virtual ~ActEvent(){}
		virtual void act(ToolKit* _pToolKit) = 0;
};
/**
	@brief ToolKit Evnet Interface

	ActEvent 와 FocusEvent 객체를 가지는 컨테이너 클래스 \n
	이벤트들은 Command 패턴으로 호출된다.
*/
class ToolKitEvent {
	public:
		ToolKitEvent() : pFocusEvent(NULL), pActEvent(NULL) {}
		~ToolKitEvent(){
			if ( pFocusEvent != NULL ){ delete pFocusEvent; pFocusEvent = NULL; }
			if ( pActEvent != NULL ){ delete pActEvent; pActEvent = NULL; }
		}
		FocusEvent* pFocusEvent;
		ActEvent* pActEvent;
};

/**
	@brief ToolKit Interface

	컨테이너 Actor클래스인 TookKit 추상 클래스(인터페이스)
*/
class ToolKit : public Actor {
public:
	virtual ~ToolKit(){
		vector<ToolKitEvent*>::iterator itr;
		for(itr = toolKitEventPocket.begin(); itr != toolKitEventPocket.end(); itr++){
			delete *itr;
		}
	}
	vector<Actor*> actorPocket;
	vector<ToolKitEvent*> toolKitEventPocket;
};
#endif