#pragma once
#include "AbstractStatisticsObserver.h"
#include "AbstractSimulationResultDTOFactory.h"
#include "AbstractSimulator.h"
#include "MultipleSimulationResultDTO.h"
#include "SingleSimulationResultDTO.h"
#include "StepResultDTO.h"
#include "ServiceInfoDTO.h"
#include "ArrivalsInfoDTO.h"
#include "ExitsInfoDTO.h"
#include "StepResultDTO.h"
#include "DTOIterator.h"
#include "ResultDTOIteratorFactory.h"


class StatisticsSimulatorObserver:virtual public AbstractStatisticsObserver,virtual public AbstractSimulationResultDTOFactory
{

private:
	static StatisticsSimulatorObserver *_instance;
public:
	static StatisticsSimulatorObserver* instance();
	void setSimulator(AbstractSimulator* _simulator);
	void AbstractStatisticsObserver::updateStep();
	void AbstractStatisticsObserver::updateSimulation();
	void AbstractStatisticsObserver::updateMultipleSimulations();
	void AbstractStatisticsObserver::reset();
	StepResultDTO* AbstractSimulationResultDTOFactory::getStepResultDTO();
	MultipleSimulationResultDTO* AbstractSimulationResultDTOFactory::getMultipleSimulationResultDTO();
	SingleSimulationResultDTO* AbstractSimulationResultDTOFactory::getSingleSimulationResultDTO();
	StatisticsSimulatorObserver(){
		simulationCounter = 0;
		stepCounter = 0;
		multipleSimulationResultDTO = new MultipleSimulationResultDTO();
		singleSimulationResultDTO =new SingleSimulationResultDTO();
		singleSimulationResultDTO->setID(simulationCounter);
		stepResultDTO = new StepResultDTO();
		service1 = new ServiceInfoDTO();
		service1->setID(string("service1"));
		service2 = new ServiceInfoDTO();
		service2->setID(string("service2"));
		service3 = new ServiceInfoDTO();
		service3->setID(string("service3"));
		service4Coats = new ServiceInfoDTO();
		service4Coats->setID(string("service4Coats"));
		service4Pants = new ServiceInfoDTO();
		service4Pants->setID(string("service4Pants"));
		service4Suits = new ServiceInfoDTO();
		service4Suits->setID(string("service4Suits"));
		service5 = new ServiceInfoDTO();
		service5->setID(string("service5"));
		arrivals = new ArrivalsInfoDTO();
		arrivals->setID(string("arrivals"));
		exits = new ExitsInfoDTO();
		exits->setID(string("exits"));
		numberFlawedSuits = 0;
		numberNotFlawedSuits = 0;
	}



private:
	AbstractSimulator* simulator;
	MultipleSimulationResultDTO* multipleSimulationResultDTO;
	SingleSimulationResultDTO* singleSimulationResultDTO;
	StepResultDTO* stepResultDTO;
	ServiceInfoDTO* service1;
	ServiceInfoDTO* service2;
	ServiceInfoDTO* service3;
	ServiceInfoDTO* service4Coats;
	ServiceInfoDTO* service4Pants;
	ServiceInfoDTO* service4Suits;
	ServiceInfoDTO* service5;
	ArrivalsInfoDTO* arrivals;
	ExitsInfoDTO* exits;
	int numberFlawedSuits;
	int numberNotFlawedSuits;
	int simulationCounter;
	int stepCounter;


};