libscid snapshot+e944e108ed8b
Chess applications made easy.
Source on GitHub License GPL v2
Loading...
Searching...
No Matches
nags.h File Reference

Numeric annotation glyphs and PGN annotation conversion helpers. More...

#include <cstdint>
#include <string>
#include <string_view>
+ Include dependency graph for nags.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  scid
 Public namespace for libscid.
 
namespace  scid::core
 Chess games, positions, movetext and notation.
 

Enumerations

enum class  scid::core::Nag : std::uint8_t {
  None = 0 , GoodMove = 1 , PoorMove = 2 , ExcellentMove = 3 ,
  Blunder = 4 , InterestingMove = 5 , DubiousMove = 6 , OnlyMove = 8 ,
  Equal = 10 , Unclear = 13 , WhiteSlight = 14 , BlackSlight = 15 ,
  WhiteClear = 16 , BlackClear = 17 , WhiteDecisive = 18 , BlackDecisive = 19 ,
  WhiteCrushing = 20 , BlackCrushing = 21 , ZugZwang = 22 , BlackZugZwang = 23 ,
  MoreRoom = 26 , DevelopmentAdvantage = 35 , WithInitiative = 36 , WithAttack = 40 ,
  WithBlackAttack = 41 , Compensation = 44 , SlightCentre = 48 , Centre = 50 ,
  SlightKingSide = 54 , ModerateKingSide = 56 , KingSide = 58 , SlightQueenSide = 60 ,
  ModerateQueenSide = 62 , QueenSide = 64 , SlightCounterPlay = 130 , BlackSlightCounterPlay = 131 ,
  CounterPlay = 132 , BlackCounterPlay = 133 , DecisiveCounterPlay = 134 , BlackDecisiveCounterPlay = 135 ,
  TimeLimit = 136 , WithIdea = 140 , BetterIs = 142 , VariousMoves = 144 ,
  Comment = 145 , Novelty = 146 , WeakPoint = 147 , Ending = 148 ,
  File = 149 , Diagonal = 150 , BishopPair = 151 , OppositeBishops = 153 ,
  SameBishops = 154 , Etc = 190 , DoublePawns = 191 , SeparatedPawns = 192 ,
  UnitedPawns = 193 , Diagram = 201 , See = 210 , Mate = 211 ,
  PassedPawn = 212 , MorePawns = 213 , With = 214 , Without = 215
}
 Numeric annotation glyph values used in PGN movetext. More...
 

Functions

constexpr std::uint8_t scid::core::nagCode (Nag nag)
 Returns the PGN numeric code for nag.
 
constexpr Nag scid::core::nagFromCode (std::uint8_t value)
 Builds a Nag value from a numeric PGN code.
 
std::string scid::core::nagToString (Nag nag, bool asSymbol)
 Formats nag as a symbolic annotation when possible, or $n.
 
std::string_view scid::core::nagToSymbol (Nag nag)
 Returns the symbolic form for nag, or an empty view if none is known.
 
Nag scid::core::nagFromString (std::string_view text)
 Parses symbolic, bare numeric, or $n NAG text.
 

Variables

constexpr std::uint8_t scid::core::maxNagCode = nagCode(Nag::Without)
 Largest named Nag code currently recognised by libscid.
 

Detailed Description

Numeric annotation glyphs and PGN annotation conversion helpers.