stellar

Stellar - UCI Chess engine written in C++20
git clone git://git.dimitrijedobrota.com/stellar.git
Log | Files | Refs | README | LICENSE

color.hpp (384B)


      1 #ifndef STELLAR_COLOR_H
      2 #define STELLAR_COLOR_H
      3 
      4 #include <string>
      5 
      6 namespace color {
      7 
      8 enum Color {
      9     WHITE = 0,
     10     BLACK
     11 };
     12 
     13 inline constexpr const Color other(const Color color) { return color == WHITE ? BLACK : WHITE; }
     14 inline constexpr const std::string to_string(const Color color) {
     15     return std::string(color == WHITE ? "white" : "black");
     16 }
     17 
     18 } // namespace color
     19 
     20 #endif