#include "SysTriggerV_AllPlayer.h"
#include "SysTriggerV_Player1.h"
#include "SysTriggerV_Player2.h"

void SysTriggerV_AllPlayer::Step()
{
	auto v1 = std::make_shared<SysTriggerV_Player1>();
	v1->x = x;
	v1->y = y;
	v1->el.eid = el.eid;
	v1->el.eventName = el.eventName;
	v1->el.arg = el.arg;
	v1->el.arg2 = el.arg2;
	v1->el.arg3 = el.arg3;
	v1->el.flag = el.flag;
	gameFunc->SetEntity(shared_from_this(), v1);
	auto v2 = std::make_shared<SysTriggerV_Player2>();
	v2->x = x;
	v2->y = y;
	v2->el.eid = el.eid;
	v2->el.eventName = el.eventName;
	v2->el.arg = el.arg;
	v1->el.arg2 = el.arg2;
	v1->el.arg3 = el.arg3;
	v2->el.flag = el.flag;
	gameFunc->SetEntity(shared_from_this(), v2);
	Destroy();
}

std::shared_ptr<Entity> CreateSysTriggerV_AllPlayer()
{
	return std::make_shared<SysTriggerV_AllPlayer>();
}
