Пример #1
0
        public MainWindow()
        {
            InitializeComponent();
            MovesHistory movesHistory = new MovesHistory();
            UISettings   gmSettings   = new UISettings();

            settingsData.Load(gmSettings);
            gm                      = new GameManager(Board, movesHistory, gmSettings);
            DataContext             = gm;
            MovesListTB.DataContext = movesHistory;
            gm.NewGame();
        }
Пример #2
0
 public GameManager(Canvas boardCanvas, MovesHistory movesHistory, ISettings settings)
 {
     this.boardCanvas       = boardCanvas;
     this.movesHistory      = movesHistory;
     this.settings          = settings;
     engineConfig           = settings;
     boardCanvas.Background = new ImageBrush
     {
         ImageSource = GetImage("board.png")
     };
     lastMoveHighlight = new LastMoveHighlight(this, boardCanvas);
     gameState         = new GameState(pregeneratedAttacks, zobristHashUtils);
     openingBook       = new OpeningBook(pregeneratedAttacks, zobristHashUtils);
     engine            = new ArtemisEngine(gameState, engineConfig, openingBook);
 }