Belofte  version 2.1.5
A promising chess program using the UCI or Winboard interface
searchscore.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------+
2  * File: searchscore.h
3  * Project: part of belofte - A Promising Chess Program
4  * Author: yves
5  * SPDX-License-Identifier: GPL-2.0-only
6 +----------------------------------------------------------------------*/
7 
8 #if !defined(SEARCHSCORE_H)
9 #define SEARCHSCORE_H
10 
11 //-----------------------------------------------------------------------
12 
13 enum tScoreType : uint8_t {
14  SC_UNDEF = 0,
16  SC_SIZE
17 };
18 
19 typedef enum tScoreType scoretype_t;
20 
21 class bSearchScore {
22 public:
23  bSearchScore(bSearchScore const& sc) noexcept;
24  explicit bSearchScore(bScore const& sc) noexcept;
25  explicit bSearchScore(bScore const& sc, scoretype_t const& st) noexcept;
26  explicit bSearchScore(bBestMoveInfo const& bmi, scoretype_t const& st) noexcept;
27  bSearchScore(bSearchScore&& sc) noexcept;
28  ~bSearchScore();
29 
30  bSearchScore& operator=(bSearchScore&& sc) noexcept;
31  bSearchScore& operator=(bScore const& sc) noexcept;
32  bSearchScore& operator=(bScore&& sc) noexcept;
33  bSearchScore operator-() const;
34 
35  bSearchScore& operator=(bSearchScore const&) = delete;
36 
37  operator std::string() const;
38  bScore getScore() const { return m_score; }
39  bScore getRealScore() const { return belofte::realScore(m_score); }
40 
41  friend std::string const operator+(std::string const& lhs, bSearchScore const& sc);
42  friend std::string const operator+(bSearchScore const& sc, std::string const& rhs);
43  friend bool operator>(bScore const& lhsc, bSearchScore const& rhsc);
44  friend bool operator>=(bScore const& lhsc, bSearchScore const& rhsc);
45  friend bool operator>(bSearchScore const& lhsc, bScore const& rhsc);
46  friend bool operator>(bSearchScore const& lhsc, bSearchScore const& rhsc);
47 
48 private:
49  bScore m_score = SCORE_UNDEFINED;
51 };
52 
53 //-----------------------------------------------------------------------
54 
55 #endif // defined SEARCHSCORE_H
56 
57 // eof
int_fast16_t bScore
used to return id of move in movelist
Definition: belofte.h:104
bSearchScore operator-() const
Definition: searchscore.cpp:67
bSearchScore & operator=(bSearchScore &&sc) noexcept
Definition: searchscore.cpp:41
bSearchScore & operator=(bSearchScore const &)=delete
friend std::string const operator+(std::string const &lhs, bSearchScore const &sc)
Definition: searchscore.cpp:79
friend bool operator>(bScore const &lhsc, bSearchScore const &rhsc)
Definition: searchscore.cpp:89
bScore getRealScore() const
Definition: searchscore.h:39
bScore getScore() const
Definition: searchscore.h:38
friend bool operator>=(bScore const &lhsc, bSearchScore const &rhsc)
Definition: searchscore.cpp:94
bSearchScore(bSearchScore const &sc) noexcept
Definition: searchscore.cpp:23
constexpr bScore SCORE_UNDEFINED
Definition: eval.h:20
bScore realScore(bScore const sc)
Definition: eval.cpp:23
tScoreType
Definition: searchscore.h:13
@ SC_BETA
Definition: searchscore.h:15
@ SC_BEST
Definition: searchscore.h:15
@ SC_CHILD
Definition: searchscore.h:15
@ SC_SIZE
Definition: searchscore.h:16
@ SC_UNDEF
Definition: searchscore.h:14
@ SC_ALPHA
Definition: searchscore.h:15
enum tScoreType scoretype_t
Definition: searchscore.h:19