libscid 0.1.0
Chess applications made easy.
Loading...
Searching...
No Matches
nags.h
1#pragma once
2
3#include <cstdint>
4#include <string>
5#include <string_view>
6
7namespace scid::core {
8
9enum class Nag : std::uint8_t {
10 None = 0,
11 GoodMove = 1,
12 PoorMove = 2,
13 ExcellentMove = 3,
14 Blunder = 4,
15 InterestingMove = 5,
16 DubiousMove = 6,
17 OnlyMove = 8,
18 Equal = 10,
19 Unclear = 13,
20 WhiteSlight = 14,
21 BlackSlight = 15,
22 WhiteClear = 16,
23 BlackClear = 17,
24 WhiteDecisive = 18,
25 BlackDecisive = 19,
26 WhiteCrushing = 20,
27 BlackCrushing = 21,
28 ZugZwang = 22,
29 BlackZugZwang = 23,
30 MoreRoom = 26,
31 DevelopmentAdvantage = 35,
32 WithInitiative = 36,
33 WithAttack = 40,
34 WithBlackAttack = 41,
35 Compensation = 44,
36 SlightCentre = 48,
37 Centre = 50,
38 SlightKingSide = 54,
39 ModerateKingSide = 56,
40 KingSide = 58,
41 SlightQueenSide = 60,
42 ModerateQueenSide = 62,
43 QueenSide = 64,
44 SlightCounterPlay = 130,
45 BlackSlightCounterPlay = 131,
46 CounterPlay = 132,
47 BlackCounterPlay = 133,
48 DecisiveCounterPlay = 134,
49 BlackDecisiveCounterPlay = 135,
50 TimeLimit = 136,
51 WithIdea = 140,
52 BetterIs = 142,
53 VariousMoves = 144,
54 Comment = 145,
55 Novelty = 146,
56 WeakPoint = 147,
57 Ending = 148,
58 File = 149,
59 Diagonal = 150,
60 BishopPair = 151,
61 OppositeBishops = 153,
62 SameBishops = 154,
63 Etc = 190,
64 DoublePawns = 191,
65 SeparatedPawns = 192,
66 UnitedPawns = 193,
67 Diagram = 201,
68 See = 210,
69 Mate = 211,
70 PassedPawn = 212,
71 MorePawns = 213,
72 With = 214,
73 Without = 215
74};
75
76constexpr std::uint8_t nagCode(Nag nag) {
77 return static_cast<std::uint8_t>(nag);
78}
79
80constexpr Nag nagFromCode(std::uint8_t value) {
81 return static_cast<Nag>(value);
82}
83
84inline constexpr std::uint8_t maxNagCode = nagCode(Nag::Without);
85
86std::string nagToString(Nag nag, bool asSymbol);
87std::string_view nagToSymbol(Nag nag);
88Nag nagFromString(std::string_view text);
89
90} // namespace scid::core