add platform filter to b_manage
This commit is contained in:
@@ -18,8 +18,8 @@
|
||||
namespace platform {
|
||||
const std::string STATUS_OK = "Ok.";
|
||||
const std::string STATUS_COLOR = Colors::GREEN();
|
||||
ManageScreen::ManageScreen(int rows, int cols, const std::string& model, const std::string& score, bool complete, bool partial, bool compare) :
|
||||
rows{ rows }, cols{ cols }, complete{ complete }, partial{ partial }, compare{ compare }, didExcel(false), results(ResultsManager(model, score, complete, partial))
|
||||
ManageScreen::ManageScreen(int rows, int cols, const std::string& model, const std::string& score, const std::string& platform, bool complete, bool partial, bool compare) :
|
||||
rows{ rows }, cols{ cols }, complete{ complete }, partial{ partial }, compare{ compare }, didExcel(false), results(ResultsManager(model, score, platform, complete, partial))
|
||||
{
|
||||
results.load();
|
||||
openExcel = false;
|
||||
|
@@ -14,7 +14,7 @@ namespace platform {
|
||||
};
|
||||
class ManageScreen {
|
||||
public:
|
||||
ManageScreen(int rows, int cols, const std::string& model, const std::string& score, bool complete, bool partial, bool compare);
|
||||
ManageScreen(int rows, int cols, const std::string& model, const std::string& score, const std::string& platform, bool complete, bool partial, bool compare);
|
||||
~ManageScreen() = default;
|
||||
void doMenu();
|
||||
private:
|
||||
|
@@ -3,8 +3,8 @@
|
||||
#include "ResultsManager.h"
|
||||
|
||||
namespace platform {
|
||||
ResultsManager::ResultsManager(const std::string& model, const std::string& score, bool complete, bool partial) :
|
||||
path(Paths::results()), model(model), scoreName(score), complete(complete), partial(partial), maxModel(0), maxTitle(0)
|
||||
ResultsManager::ResultsManager(const std::string& model, const std::string& score, const std::string& platform, bool complete, bool partial) :
|
||||
path(Paths::results()), model(model), scoreName(score), platform(platform), complete(complete), partial(partial), maxModel(0), maxTitle(0)
|
||||
{
|
||||
}
|
||||
void ResultsManager::load()
|
||||
@@ -17,7 +17,11 @@ namespace platform {
|
||||
auto result = Result();
|
||||
result.load(path, filename);
|
||||
bool addResult = true;
|
||||
if (model != "any" && result.getModel() != model || scoreName != "any" && scoreName != result.getScoreName() || complete && !result.isComplete() || partial && result.isComplete())
|
||||
if (platform != "any" && result.getPlatform() != platform
|
||||
|| model != "any" && result.getModel() != model
|
||||
|| scoreName != "any" && scoreName != result.getScoreName()
|
||||
|| complete && !result.isComplete()
|
||||
|| partial && result.isComplete())
|
||||
addResult = false;
|
||||
if (addResult) {
|
||||
files.push_back(result);
|
||||
|
@@ -18,7 +18,7 @@ namespace platform {
|
||||
};
|
||||
class ResultsManager {
|
||||
public:
|
||||
ResultsManager(const std::string& model, const std::string& score, bool complete, bool partial);
|
||||
ResultsManager(const std::string& model, const std::string& score, const std::string& platform, bool complete, bool partial);
|
||||
void load(); // Loads the list of results
|
||||
void sortResults(SortField field, SortType type); // Sorts the list of results
|
||||
void sortDate(SortType type);
|
||||
@@ -38,6 +38,7 @@ namespace platform {
|
||||
std::string path;
|
||||
std::string model;
|
||||
std::string scoreName;
|
||||
std::string platform;
|
||||
bool complete;
|
||||
bool partial;
|
||||
int maxModel;
|
||||
|
Reference in New Issue
Block a user