コード例 #1
0
ファイル: This.cs プロジェクト: Puddler/Chess
        public void SetupStartPosition()
        {
            Window newGameWindow = new NewGameUI();

            if (NewGameVM.VM == null)
            {
                NewGameVM.VM = new NewGameVM();
            }
            newGameWindow.DataContext = NewGameVM.VM;
            if (This.Bot != null)
            {
                NewGameVM.VM.SelectedBot = This.Bot;
            }
            newGameWindow.ShowDialog();

            if (NewGameUI.Reset)
            {
                NewGameUI.Reset = false;
                This.Board.ClearBoard();

                this.CreatePieces();

                this.White.SetCurrentMove(null);
                this.White.PreviousMove = null;
                this.White.Moves.Clear();
                this.White.CapturedMaterials.Clear();
                this.White.KingStatus = KingStatus.Move;

                this.Black.SetCurrentMove(null);
                this.Black.PreviousMove = null;
                this.Black.Moves.Clear();
                this.Black.CapturedMaterials.Clear();
                this.Black.KingStatus = KingStatus.Move;

                this.CurrentPlayer = this.White;

                This.Board.SetupStartPosition();
                This.Board.ResetLegalMoves();
                This.Board.ResetBoardColors();
            }
        }
コード例 #2
0
ファイル: MainMenu.cs プロジェクト: diermas/Aeternia
 public void ReturnToMenu()
 {
     MainMenuUI.SetActive(true);
     NewGameUI.SetActive(false);
 }