示例#1
0
文件: Game.cs 项目: tekavec/Trivia
 public Game(Action<string> writeLine, string[] players)
 {
     _players = new Players();
     CreatePlayers(players);
     _gameEngine = new GameEngine(_players, new GamePrinter(writeLine));
     _gamePrinter = new GamePrinter(writeLine);
     _gamePrinter.PrintoutPlayers(players);
 }
示例#2
0
 public void Init()
 {
     _gamePrinter = new GamePrinter(_console.WriteLine);
     _mockedPlayer = Substitute.For<IPlayer>();
     _players = Substitute.For<IPlayers>();
     _gameEngine = new GameEngine(_players, _gamePrinter);
     _playerA = new Player("ana", _defaultLocation, _defaultNumberOfCoins);
     _playerB = new Player("bob", _defaultLocation, _defaultNumberOfCoins);
 }
示例#3
0
 public GameEngine(IPlayers players, GamePrinter gamePrinter)
 {
     _players = players;
     _gamePrinter = gamePrinter;
     _currentPlayer = players.GetNextPlayer();
 }