示例#1
0
        private static void DoTopScores(Game g, ScoreBoard board)
        {
            if (g.score != -1 && g.score < board.board[4].Score)
            {
                Console.Write("TOP SCORE! Please enter your name:");
                string name = Console.ReadLine();

                List<Record> list = new List<Record>(board.board);
                list.Add(new Record(name, g.score));
                list.Sort();
                for (int i = 0; i < 5; i++)
                    board.board[i] = list[i];
            }
        }
示例#2
0
 static void Main()
 {
     ScoreBoard board = new ScoreBoard();
     while (new Game(board, DoTopScores).Run()) { }
 }
示例#3
0
 public Game(ScoreBoard bb, TopScoresDelegate doTopScores)
 {
     this.myBoard     = bb;
     this.doTopScores = doTopScores;
 }
示例#4
0
 public Game(ScoreBoard bb, TopScoresDelegate doTopScores)
 {
     this.myBoard = bb;
     this.doTopScores = doTopScores;
 }