#pragma once
#include "Event.h"
#include "Suit.h"
#include "Pants.h"
#include "Coat.h"
#include "SimulatorSingleton.h"
#include "ProcessFlaws.h"

class EvaluateFlaws: public Event
{
public:
	EvaluateFlaws(double time):Event(time){}

	void Event::action()
	{
		SimulatorSingleton *sim = SimulatorSingleton::instance();
		Pants pants = suit.getPants();
		Coat coat = suit.getCoat();
		if (suit.isFlawed()) {
			double timeService = sim->rStreamManager->rStream6->exponential(12);
			ProcessFlaws *processFlaws = new ProcessFlaws(getTime() + timeService);
			processFlaws->suit = suit;
			sim->add_event(processFlaws);
		}
		else {
			suit.setEndTime(getTime());
		}
	}

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

	Suit suit;
};