示例#1
0
文件: Game.cs 项目: azrielb/Homework
 //Reset the game
 public void reset(string firstPlayerName = "", string secondPlayerName = "")
 {
     if (!string.IsNullOrWhiteSpace(firstPlayerName))
         first = new Player(firstPlayerName.Trim());
     else if (first == null)
         first = new Player("First player");
     if (!string.IsNullOrWhiteSpace(secondPlayerName))
         second = new Player(secondPlayerName.Trim());
     else if (second == null)
         second = new Player("Second player");
     cardDeck = new CardStock(first, second);
 }
示例#2
0
文件: Game.cs 项目: azrielb/Homework
 //Constructor:
 public Game(string firstPlayerName = "", string secondPlayerName = "")
 {
     first = new Player(string.IsNullOrWhiteSpace(firstPlayerName) ? "First player" : firstPlayerName.Trim());
     second = new Player(string.IsNullOrWhiteSpace(secondPlayerName) ? "Second player" : secondPlayerName.Trim());
     cardDeck = new CardStock(first, second);
 }