12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #ifndef CHESSY_MINMAX_H
- #define CHESSY_MINIMAX_H
- #include "MoveGeneration.h"
- namespace chessy
- {
- class MiniMax;
- }
- class chessy::MiniMax
- {
- ChessGame& game;
- struct BestMove {
- Move move;
- float value;
- inline void overwriteIfBetter(BestMove other)
- {
- if (other.value > value)
- *this = other;
- }
- };
- public:
- inline MiniMax(ChessGame& game) :
- game{ game } {}
- Move calculateBest(int depth)
- {
- minimax<WHITE_SIDE>(depth);
- return {0, 0};
- }
- template<Side side>
- float evaluate(void) const;
- private:
- template<Side side>
- float minimax(int depth);
- };
- #endif // CHESSY_MINIMAX_H
|