2017-08-25 23:12:27 +02:00
|
|
|
//
|
|
|
|
// Created by Syméon on 25/08/2017.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "Chart.h"
|
|
|
|
|
|
|
|
int Chart::getResolution() const {
|
|
|
|
return resolution;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Chart::setResolution(int resolution) {
|
2018-12-23 01:55:43 +01:00
|
|
|
if (resolution <= 0) {
|
|
|
|
throw std::invalid_argument("Can't set a resolution of "+std::to_string(resolution));
|
|
|
|
} else {
|
|
|
|
this->resolution = resolution;
|
|
|
|
}
|
2017-08-25 23:12:27 +02:00
|
|
|
}
|
|
|
|
|
2018-12-23 01:55:43 +01:00
|
|
|
Chart::Chart(const std::string &dif, int level, int resolution) : dif_name(dif),
|
2017-08-25 23:12:27 +02:00
|
|
|
level(level),
|
|
|
|
resolution(resolution),
|
2019-01-14 21:43:56 +01:00
|
|
|
Notes() {
|
|
|
|
if (resolution <= 0) {
|
|
|
|
throw std::invalid_argument("Can't set a resolution of "+std::to_string(resolution));
|
|
|
|
}
|
|
|
|
}
|
2019-01-16 01:59:02 +01:00
|
|
|
|
|
|
|
bool Chart::operator==(const Chart &rhs) const {
|
|
|
|
return dif_name == rhs.dif_name &&
|
|
|
|
level == rhs.level &&
|
|
|
|
Notes == rhs.Notes &&
|
|
|
|
resolution == rhs.resolution;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Chart::operator!=(const Chart &rhs) const {
|
|
|
|
return !(rhs == *this);
|
|
|
|
}
|