#ifndef DEVICE_ITEM_H
#define DEVICE_ITEM_H

#include <string>

class DeviceItem {
private:
	std::wstring name_;
	double energyRatio_;
	int maximumEnergy_;
	int energyPriority_;
	bool turnOffOnLack_;
	
public:
	static const int MINIMUM_ENERGY_PRIORITY;
	static const int MAXIMUM_ENERGY_PRIORITY;

	static const int MINIMUM_MAXIMUM_ENERGY;
	static const int MAXIMUM_MAXIMUM_ENERGY;

	static const int MINIMUM_ENERGY_RATIO;
	static const int MAXIMUM_ENERGY_RATIO;
public:
	const std::wstring & getName() const {
		return name_;
	}

	DeviceItem(const std::wstring & name) {
		this->name_ = name;

		energyPriority_ = MINIMUM_ENERGY_PRIORITY;		
		maximumEnergy_ = MINIMUM_MAXIMUM_ENERGY;
		energyRatio_ = MINIMUM_ENERGY_RATIO;

		turnOffOnLack_ = false;
	}

	void updateEnergyRatio(double coefficient) {
		this->energyRatio_ = this->energyRatio_ * coefficient;
	}

	double getEnergyRatio() {
		return this->energyRatio_;
	}

	void setEnergyRatio(double value) {
		this->energyRatio_ = value;
	}

	int getEnergyPriority() {
		return energyPriority_;
	}

	void setEnergyPriority(int value) {
		this->energyPriority_ = value;
	}

	void setMaximumEnergy(int value) {
		maximumEnergy_ = value;
	}

	int getMaximumEnergy() {
		return maximumEnergy_;
	}

	bool getTurnOffOnLack() {
		return turnOffOnLack_;
	}

	void setTurnOffOnLack(bool value) {
		this->turnOffOnLack_ = value;
	}
};

#endif