mirror of
https://gitlab.com/manzerbredes/ochess.git
synced 2025-04-10 08:20:23 +00:00
22 lines
843 B
C++
22 lines
843 B
C++
![]() |
#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));
|
||
|
}
|
||
|
}
|
||
|
}
|