예제 #1
0
        static void StartNewSession()
        {
            Console.WriteLine("Please enter your name first:");

            var playerName = Console.ReadLine();

            _humanPlayer    = _componentsFactory.CreatePlayer <GamePlayer>(playerName);
            _computerPlayer = _componentsFactory.CreatePlayer <ComputerGamePlayer>("COMP");

            Console.WriteLine("Press ENTER to start new game session.");
            Console.ReadLine();

            _session.Start(_humanPlayer, _computerPlayer);
        }
예제 #2
0
        static void Main(string[] args)
        {
            // Set the stage
            SetConsoleProperties();

            IGameSession gameSession = GameSessionFactory.CreateGameSession();

            gameSession.Start();

            if (Console.ReadLine() == "y")
            {
                Main(null);
            }
            else
            {
                Environment.Exit(0);
            }
        }
예제 #3
0
 public void StartGameSession()
 {
     currentGameSession = new GameSession();
     currentGameSession.Start(gameState);
 }