threatmateState.cc Source File

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
threatmateState.cc
Go to the documentation of this file.
1 /* threatmateState.cc
2 */
3 #include "osl/search/threatmateState.h"
4 #include "osl/record/csa.h"
5
6 const osl::CArray<osl::search::ThreatmateState::Status,5*2>
7 osl::search::ThreatmateState::transition = {{
8 /*UNKNOWN*/ UNKNOWN, UNKNOWN,
9 /*THREATMATE*/ MAY_HAVE_CHECKMATE, CHECK_AFTER_THREATMATE,
10 /*MAYBE_THREATMATE*/ MAY_HAVE_CHECKMATE, CHECK_AFTER_THREATMATE,
11 /*CHECK_AFTER_THREATMATE*/ MAYBE_THREATMATE, UNKNOWN,
12 /*MAY_HAVE_CHECKMATE*/ UNKNOWN, UNKNOWN,
13 }};
14
15 #ifndef MINIMAL
16 std::ostream& osl::search::operator<<(std::ostream& os, ThreatmateState s)
17 {
18 switch (s.status())
19 {
20 case ThreatmateState::THREATMATE:
21 return os << "THREATMATE "; // << record::csa::show(s.threatmate_move);
22 case ThreatmateState::MAYBE_THREATMATE:
23 return os << "maybe threatmate";
24 case ThreatmateState::MAY_HAVE_CHECKMATE:
25 return os << "may have checkmate";
26 case ThreatmateState::CHECK_AFTER_THREATMATE:
27 return os << "check after threatmate";
28 default:
29 return os << "unkown";
30 }
31 }
32 #endif
33 /* ------------------------------------------------------------------------- */
34 // ;;; Local Variables:
35 // ;;; mode:c++
36 // ;;; c-basic-offset:2
37 // ;;; End: