public MainWindow() { InitializeComponent(); ChessBoardModel = new ChessBoardModel(); // Initialize ChessBoardModel. ViewModel = new ChessViewModel(ref ChessBoardModel); // Initialize ViewModel. ChessBoard = new ChessBoard(ref ViewModel); // Initialize ChessBoard. ChessBoardFrame.Content = ChessBoard; // Set ChessBoardFrame content to the ChessBoard. DataContext = ViewModel; // Set the DataContext to the ViewModel. }
public ChessEngine(ref ChessBoardModel chessBoard, ref ChessViewModel viewModel, bool player) { // Initialize ChessBoard. ChessBoard = chessBoard; // Initialize ViewModel. ViewModel = viewModel; // Initialize the Player true = white, false = black. Player = player; // Initialize BoardDepth. BoardDepth = 4; // ThreadStart variable initializes with the start method which the Thread will run. ThreadStart engineStart = new ThreadStart(start); // Initialize the Engine Thread with engineStart. Engine = new Thread(engineStart); // Start Engine Thread; Engine.Start(); }