aboutsummaryrefslogtreecommitdiff
path: root/src/game_tab/Game.cpp
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2023-01-16 17:18:54 +0100
committerLoic Guegan <manzerbredes@mailbox.org>2023-01-16 17:18:54 +0100
commit3846e5f9f6337774ac808963d4f53a043993c59b (patch)
treee42ec30c5ce2deab9cb26e76d8fb2db59f4dc054 /src/game_tab/Game.cpp
parent3b11b9d4f3eee5faa656d7ee61077e80726bdc36 (diff)
Update metadata and debug opening guesser
Diffstat (limited to 'src/game_tab/Game.cpp')
-rw-r--r--src/game_tab/Game.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/game_tab/Game.cpp b/src/game_tab/Game.cpp
index 9028223..c1aa605 100644
--- a/src/game_tab/Game.cpp
+++ b/src/game_tab/Game.cpp
@@ -145,21 +145,8 @@ void Game::GetOpening(std::string &name,std::string &eco){
}else {
// If not, get the current move line (or first move)
// and try to guess opening
- auto line=m->GetLine(); // Vector of HalfMove
- std::string pgn;
- int count=1;
- for(int i=0;i<line.size();i++){
- if(i%2==0){
- pgn+=std::to_string(count)+".";
- count+=1;
- }
- pgn+=line[i]->move +" ";
- }
- // If there is a line, try to guess the opening
- if(pgn.size()>0){
- wxGetApp().GetBook().GuessOpening(pgn,name,eco);
- m->SetOpening(name,eco);
- }
+ wxGetApp().GetBook().GuessOpening(m->GetLineAsSAN(),name,eco);
+ m->SetOpening(name,eco);
}
}
}