analysesResult.h Source File

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
analysesResult.h
Go to the documentation of this file.
1 /* analysesResult.h
2 */
3 #ifndef OSL_ANNOTATE_ANALYSESRESULT_H
4 #define OSL_ANNOTATE_ANALYSESRESULT_H
5
6 #include "osl/move.h"
7 #include "osl/piece.h"
8 #include "osl/stl/vector.h"
9 #include <iosfwd>
10
11 namespace osl
12 {
13 namespace annotate
14 {
15 enum Trivalent { Unknown=0, True=1, False=-1 };
16 struct AnalysesResult
17 {
18 struct CheckmateForCapture
19 {
20 int safe_count, checkmate_count, see_plus_checkmate_count;
21 CheckmateForCapture()
22 : safe_count(0), checkmate_count(0), see_plus_checkmate_count(0)
23 {
24 }
25 bool operator==(const CheckmateForCapture& r) const
26 {
27 return safe_count == r.safe_count
28 && checkmate_count == r.checkmate_count
29 && see_plus_checkmate_count == r.see_plus_checkmate_count;
30 }
31 };
32 struct CheckmateForEscape
33 {
34 int safe_count, checkmate_count;
35 CheckmateForEscape() : safe_count(0), checkmate_count(0)
36 {
37 }
38 bool operator==(const CheckmateForEscape& r) const
39 {
40 return safe_count == r.safe_count
41 && checkmate_count == r.checkmate_count;
42 }
43 };
44 struct ThreatmateIfMorePieces
45 {
46 vector<Ptype> hand_ptype;
47 vector<Piece> board_ptype;
48 bool operator==(const ThreatmateIfMorePieces& r) const
49 {
50 return hand_ptype == r.hand_ptype
51 && board_ptype == r.board_ptype;
52 }
53 };
54 struct Vision
55 {
56 vector<Move> pv;
57 int eval, cur_eval;
58 };
59
60 vector<int> repetition;
61 Trivalent checkmate, checkmate_win, threatmate, escape_from_check;
62 Move checkmate_move, threatmate_move;
63 double threatmate_probability;
64 size_t threatmate_node_count;
65 CheckmateForCapture checkmate_for_capture;
66 CheckmateForEscape checkmate_for_escape;
67 ThreatmateIfMorePieces threatmate_if_more_pieces;
68 Vision vision;
69
70 AnalysesResult()
71 : checkmate(Unknown), checkmate_win(Unknown), threatmate(Unknown),
72 escape_from_check(Unknown),
73 threatmate_probability(0), threatmate_node_count(0)
74 {
75 }
76 };
77 bool operator==(const AnalysesResult& l, const AnalysesResult& r);
78 std::ostream& operator<<(std::ostream&, Trivalent);
79 std::ostream& operator<<(std::ostream&, const AnalysesResult&);
80 }
81 }
82
83 #endif /* OSL_ANNOTATE_ANALYSESRESULT_H */
84 // ;;; Local Variables:
85 // ;;; mode:c++
86 // ;;; c-basic-offset:2
87 // ;;; End: