Example #1
0
 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));
 }
Example #2
0
        //================
        //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;
        }
Example #3
0
 public NegaMaxBot(IRules rules, IBoardScoring boardScoring, ILogger <NegaMaxBot> logger)
 {
     _rules        = rules;
     _boardScoring = boardScoring;
     _logger       = logger;
 }
Example #4
0
 public BotPlayer(GameSide side, IRules rules, IBoardScoring scoring)
 {
     Side = side;
     _bot = new NegaMaxBot(rules, scoring, null);
 }