Xiangiqgame
AI engine for Xiangqi
Loading...
Searching...
No Matches
move_evaluator_human_for_concepts.hpp
Go to the documentation of this file.
1#pragma once
2
6#include <iostream>
7#include <memory>
9#include <string>
10
11namespace humanplayerio {
13 std::string input_prompt_{"Enter a move in the form 'from_space, to_space': "};
14 std::string invalid_input_msg_{"Invalid input"};
15 std::string illegal_move_msg_{"Illegal move. Please enter a different move."};
16
17public:
18 void DisplayInputPrompt();
19 void NotifyInvalidInput();
20 void NotifyIllegalMove();
21};
22} // namespace humanplayerio
23
24namespace moveselection {
28 std::istream &input_stream_;
29
30public:
31 static std::unique_ptr<HumanMoveEvaluatorForConcepts> Create(
32 gameboard::PieceColor evaluating_player,
33 std::istream &input_stream = std::cin
34 );
35
37 void NotifyIllegalMove();
38
39private:
41 gameboard::PieceColor evaluating_player,
42 std::istream &input_stream
43 );
44 gameboard::Move GetSyntacticallyValidMove(std::istream &input_stream);
45};
46
48 std::istream &input_stream_;
49
50public:
51 HumanMoveEvaluatorFactory(std::istream &input_stream = std::cin)
52 : input_stream_{input_stream} {}
53 std::unique_ptr<MoveEvaluatorBase> Create(gameboard::PieceColor evaluating_player
54 ) override;
55};
56} // namespace moveselection
std::unique_ptr< MoveEvaluatorBase > Create(gameboard::PieceColor evaluating_player) override
HumanMoveEvaluatorFactory(std::istream &input_stream=std::cin)
gameboard::Move SelectMove(const gameboard::MoveCollection &allowed_moves)
static std::unique_ptr< HumanMoveEvaluatorForConcepts > Create(gameboard::PieceColor evaluating_player, std::istream &input_stream=std::cin)
gameboard::Move GetSyntacticallyValidMove(std::istream &input_stream)
Defines GamePiece and supporting constants and free functions.
Definitions and implementations of gameboard::Move and other move-related structs.
Selecting a move to execute.
A container for multiple gameboard::Move objects.
A gameboard::BoardSpace pair (start and end).