/** Called when we click slot 3. The method loads the saved game in slot 3 for us to play. * @param sender - The button we clicked * @param e - Contains state information * @author Thomas Hooper * @date April 2019 */ private void Slot3_Click(object sender, RoutedEventArgs e) { Game game = new Game(); game = Save.LoadGame(@"C:\Users\thoop\source\repos\ChessApp\ChessApp\Saves\SaveGame3.xml"); ChessGame c = new ChessGame(game); this.NavigationService.Navigate(c); ChessBoard.Refresh(c.chessBoard.LocationGrid); c.chessBoard.SetPieces(); if (c.chessBoard.Game.HumanPlayer.Color == Color.Black) { c.Flip(); } }
/** This is called when we want to load a game from a temp file * to check if a move is valid. * @author Thomas Hooper * @date April 2019 */ public Game LoadThis() { Game game = Save.LoadGame(@"C:\Users\thoop\source\repos\ChessApp\ChessApp\Saves\TempSaveGame.xml"); return(game); }