mirror of
https://gitlab.com/manzerbredes/chess-move-interface.git
synced 2025-06-07 14:57:39 +00:00
Integrate Chess Move Interface
This commit is contained in:
parent
da88575493
commit
81f06cb209
7 changed files with 39 additions and 8 deletions
|
@ -78,4 +78,20 @@ HalfMove *HalfMove::GetHalfMoveAt(int distance) {
|
|||
return (tmp);
|
||||
}
|
||||
|
||||
CMI::HalfMove *HalfMove::GetAsCMI(){
|
||||
CMI::HalfMove *m=new CMI::HalfMove();
|
||||
m->SetSAN(move);
|
||||
m->SetNumber(count);
|
||||
m->SetIsBlack(isBlack);
|
||||
m->SetComment(comment);
|
||||
m->SetNAG(NAG);
|
||||
if(MainLine!=NULL){
|
||||
m->SetMainline(MainLine->GetAsCMI());
|
||||
}
|
||||
for (HalfMove *var : variations) {
|
||||
m->AddVariation(var->GetAsCMI());
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
} // namespace pgnp
|
|
@ -5,6 +5,8 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "CMI.hpp"
|
||||
|
||||
namespace pgnp {
|
||||
|
||||
/**
|
||||
|
@ -40,6 +42,8 @@ public:
|
|||
void Copy(HalfMove *copy);
|
||||
/// @brief Get HalfMove located x down the MainLine
|
||||
HalfMove *GetHalfMoveAt(int);
|
||||
/// @brief Get CMI version of HalfMove
|
||||
CMI::HalfMove *GetAsCMI();
|
||||
};
|
||||
|
||||
struct HalfMoveOutOfRange : public std::exception {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue