Debug HalfMove and pgn loader

This commit is contained in:
Loic Guegan 2022-02-24 19:11:44 +01:00
parent 065be164cc
commit 8e4a89ea73
5 changed files with 6 additions and 6 deletions

@ -1 +1 @@
Subproject commit 975ad849d1d1474e601ad2f4bf48ea0e4405251c Subproject commit 90050da015f3988ab3188eb19629aed262454fef

@ -1 +1 @@
Subproject commit 43434b170c2725d74f2d91f4cc86b85303893f08 Subproject commit bebbc7982482a2271096ef53c778cd93a4bbff7a

View file

@ -17,7 +17,7 @@ BaseTab::BaseTab(wxFrame *parent)
} }
void BaseTab::OnBim(wxCommandEvent &event) { void BaseTab::OnBim(wxCommandEvent &event) {
// LoadFile("/home/loic/hartwig.pgn"); LoadFile("/home/loic/hartwig.pgn");
} }
void BaseTab::OnOpenGame(wxListEvent &event) { void BaseTab::OnOpenGame(wxListEvent &event) {

View file

@ -135,9 +135,7 @@ HalfMove::HalfMove(pgnp::HalfMove *m, std::string initial_fen): capture(' ') {
this->SetMainline(new HalfMove(m->MainLine, arbiter.GetFEN())); this->SetMainline(new HalfMove(m->MainLine, arbiter.GetFEN()));
} }
for (pgnp::HalfMove *v : m->variations) { for (pgnp::HalfMove *v : m->variations) {
arbiter.Setup(initial_fen); this->AddVariation(new HalfMove(v, initial_fen));
arbiter.Play(arbiter.ParseSAN(v->move));
this->AddVariation(new HalfMove(v, arbiter.GetFEN()));
} }
} }

View file

@ -69,6 +69,8 @@ void EditorCanvas::DrawElement(const cgeditor::Element &e) {
p = 'Q'; p = 'Q';
} else if (e.prop & cgeditor::Property::King) { } else if (e.prop & cgeditor::Property::King) {
p = 'K'; p = 'K';
} else if (e.prop & cgeditor::Property::Rook) {
p = 'R';
} }
if (e.prop & cgeditor::Property::Black) { if (e.prop & cgeditor::Property::Black) {
p = std::tolower(p); p = std::tolower(p);