#pragma once
#include "Event.h"
#include "ProcessSuit.h"
#include "SimulatorSingleton.h"
#include "SuitFactory.h"
#include "ProcessCoat.h"
#include "ProcessPants.h"
#include "Suit.h"
#include "RandomStreamManager.h"
using namespace std;

class ProcessSuit: public Event
{
public:
	ProcessSuit(double time):Event(time){}
	
	void Event::action()
	{	
		SimulatorSingleton *sim = SimulatorSingleton::instance();
		double timeServiceCoat = sim->rStreamManager->rStream2->exponential(4);
		double timeServicePants = sim->rStreamManager->rStream3->exponential(5);

		ProcessCoat *processCoat = new ProcessCoat(getTime() + timeServiceCoat);
		ProcessPants *processPants = new ProcessPants(getTime() + timeServicePants);
		
		processCoat->coat = suit.getCoat();
		processPants->pants = suit.getPants();

		sim->add_event(processCoat);
		sim->add_event(processPants);
	}

	int Event::getType()
	{
		return 1;
	}

	Suit suit;
};