#include "SysTriggerH_AllPlayer.h"
#include "SysTriggerH_Player1.h"
#include "SysTriggerH_Player2.h"

void SysTriggerH_AllPlayer::Step()
{
	auto h1 = std::make_shared<SysTriggerH_Player1>();
	h1->x = x;
	h1->y = y;
	h1->el.eid = el.eid;
	h1->el.eventName = el.eventName;
	h1->el.arg = el.arg;
	h1->el.arg2 = el.arg2;
	h1->el.arg3 = el.arg3;
	h1->el.flag = el.flag;
	gameFunc->SetEntity(shared_from_this(), h1);
	auto h2 = std::make_shared<SysTriggerH_Player2>();
	h2->x = x;
	h2->y = y;
	h2->el.eid = el.eid;
	h2->el.eventName = el.eventName;
	h2->el.arg = el.arg;
	h2->el.arg2 = el.arg2;
	h2->el.arg3 = el.arg3;
	h2->el.flag = el.flag;
	gameFunc->SetEntity(shared_from_this(), h2);
	Destroy();
}

std::shared_ptr<Entity> CreateSysTriggerH_AllPlayer()
{
	return std::make_shared<SysTriggerH_AllPlayer>();
}
