#ifndef ITEM_DETAILS
#define ITEM_DETAILS

#include "SimpleItem.h"
#include "softProj\commonTypes.h"

class ShipParam
{
	EShipSectionState param_;
	std::wstring description_;
	std::string filePath_;
	bool enabled_;
public:
	ShipParam(EShipSectionState param, const std::wstring & description, const std::string & filePath, bool enabled) {
		this->param_ = param;
		this->description_ = description;
		this->filePath_ = filePath;
		this->enabled_ = enabled;
	}

	bool isEnabled() {
		return enabled_;
	}

	std::wstring getDescription() {
		return this->description_;
	}

	EShipSectionState getEnum() {
		return this->param_;
	}

	std::string getFilePath() {
		return this->filePath_;		
	}
};

class BaseParam
{
	EBaseSectionState param_;
	std::wstring description_;
	std::string filePath_;
	bool enabled_;
public:
	BaseParam(EBaseSectionState param, const std::wstring & description, const std::string & filePath, bool enabled) {
		this->param_ = param;
		this->description_ = description;
		this->filePath_ = filePath;
		this->enabled_ = enabled;
	}

	bool isEnabled() {
		return enabled_;
	}

	std::wstring getDescription() {
		return this->description_;
	}

	EBaseSectionState getEnum() {
		return this->param_;
	}

	std::string getFilePath() {
		return this->filePath_;		
	}
};

class ParamsHolder 
{
private:
	const char * folderPath_;

	ShipParam ** shipParams_;
	BaseParam ** baseParams_;
	
	int shipParamsCount_;
	int baseParamsCount_;
private:
	void createBaseParams();
	void createShipParams();

	std::string makePath(const char * filePath) 
	{
		std::string result = (std::string(folderPath_) + std::string(filePath));
		return result;
	}
public:
	ParamsHolder() 
	{
		shipParamsCount_ = 19;
		baseParamsCount_ = 18;

		folderPath_ = "../images/details/";

		createBaseParams();
		createShipParams();
	}

	int getShipParamsCount() {
		return shipParamsCount_;
	}	

	int getBaseParamsCount() {
		return baseParamsCount_;
	}	

	ShipParam * getShipParam(int index)
	{
		if (index < 0 || index > shipParamsCount_)
		{
			throw new std::exception("Index is out of range");
		}

		return shipParams_[index];
	}

	BaseParam * getBaseParam(int index)
	{
		if (index < 0 || index > baseParamsCount_)
		{
			throw new std::exception("Index is out of range");
		}

		return baseParams_[index];
	}
};

#endif