示例#1
0
 private void UpdateStatus(int row,
                           int column)
 {
     if (HasPlayerWon())
     {
         Status = GameStatus.Player.HasWon;
     }
     if (m_MineField.IsMineAt(row,
                              column))
     {
         Status = GameStatus.Player.SelectedFieldWithMine;
     }
 }
示例#2
0
        public string GameStatusToString(GameStatus.Player status)
        {
            switch (status)
            {
            case GameStatus.Player.SelectedFieldWithMine:
                return("You hit a mine!");

            case GameStatus.Player.SelectedFieldWithoutMine:
                return("Selected Field Without Mine!");

            case GameStatus.Player.HasWon:
                return("You won!");

            default:
                throw new Exception("Unknown Status: " + m_Manager.Status);
            }
        }
示例#3
0
        internal bool IsGameFinished(GameStatus.Player status)
        {
            switch (status)
            {
            case GameStatus.Player.SelectedFieldWithMine:
                m_Console.WriteLine("You hit a mine!");
                return(true);

            case GameStatus.Player.SelectedFieldWithoutMine:
                return(false);

            case GameStatus.Player.HasWon:
                m_Console.WriteLine("You won!");
                return(true);

            default:
                throw new Exception("Unknown Status: " + m_Manager.Status);
            }
        }