blob: 12b065fc68c1d3ffecf4d1d44534330f66f409cf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include "EngineTab.hpp"
EngineTab::EngineTab(wxWindow *parent, std::string engine_path_or_name)
: EngineTabBF(parent), TabInfos(TabInfos::ENGINE) {
SetLabel("New Engine");
engine = new uciadapter::UCI(engine_path_or_name);
engine_location->SetValue(engine_path_or_name);
std::vector<uciadapter::Option> opts = engine->GetOptions();
for (uciadapter::Option &opt : opts) {
if (opt.type == "check") {
engine_parameters->Append(new wxBoolProperty(
opt.name, wxPG_LABEL, opt.default_value == "true"));
} else if (opt.type == "spin") {
engine_parameters->Append(new wxIntProperty(
opt.name, wxPG_LABEL, std::stoi(opt.default_value)));
} else if (opt.type == "string") {
engine_parameters->Append(
new wxStringProperty(opt.name, wxPG_LABEL, opt.default_value));
}
}
}
|