private IBot GetSubject(IRules rules = default, IBoardScoring scoring = default) { if (rules == default) { rules = new EnglishDraughtsRules(); } if (scoring == default) { scoring = new TrivialBoardScoring(); } return(new NegaMaxBot(rules, scoring, _logger)); }
//================ //TODO: re-implement this using Commands or even Reactive approach //================ public MainWindow() { _rules = new EnglishDraughtsRules(); _boardBuilder = new DraughtsBoardBuilder(); //_boardBuilder = new PresetBoardBuilder(); _boardScoring = new TrivialBoardScoring(); _gameStatistics = new GameStatistics(); _game = new Game(_rules, _boardBuilder, _gameStatistics); _userPlayer = this; _waitHandler = new AutoResetEvent(false); WalkMoves = new Dictionary <Figure, WalkGameMove[]>(); AvailableMoves = new ObservableCollection <MovesModel>(); Cells = new ObservableCollection <Cell>(); InitializeComponent(); LayoutRoot.DataContext = this; ChessBoard.ItemsSource = Cells; }
public NegaMaxBot(IRules rules, IBoardScoring boardScoring, ILogger <NegaMaxBot> logger) { _rules = rules; _boardScoring = boardScoring; _logger = logger; }
public BotPlayer(GameSide side, IRules rules, IBoardScoring scoring) { Side = side; _bot = new NegaMaxBot(rules, scoring, null); }