示例#1
0
        static void Main(string[] args)
        {
            var player1      = new Player("Nadal", '|');
            var player2      = new Player("Federer", '|');
            var gameBall     = new Ball();
            var consoleBoard = new ConsoleBoard();
            var gamePhysics  = new Physics(gameBall, player1, player2);

            //var isHost = GameSetup.IsHost();

            //if (isHost)
            //{
            //    // run host path
            //    var host = new Host();
            //    host.ConfigureServer();
            //    host.StartServer();
            //}
            //else
            //{
            //    var client = new Client();
            //    client.ConnectToHost();
            //    // run server path
            //}
            var gameManager = new HostGameManager(consoleBoard, gameBall, player1, player2, gamePhysics);

            gameManager.StartGame();
        }
 public HostGameManager(ConsoleBoard consoleBoard, Ball ball, Player playerOne, Player playerTwo, Physics physics)
 {
     ConsoleBoard = consoleBoard;
     Ball         = ball;
     PlayerOne    = playerOne;
     PlayerTwo    = playerTwo;
     Physics      = physics;
 }