Exemple #1
0
        public void Run()
        {
            CurrentGame = new GameCore();

            Game.StartGame(CurrentGame);

            CurrentGame.TurnCompleted += Game_TurnCompleted;
            CurrentGame.GameClosed    += Game_GameClosed;

            mapStateOutput  = new MapStateOutput();
            messageOutput   = new MessageOutput(Console.BufferWidth);
            gameStateOutput = new GameStateOutput();
            InputMap        = new InputMapper();

            CurrentGame.StartGame();
            gameRunning = true;

            while (gameRunning)
            {
                ConsoleKeyInfo input = Console.ReadKey(true);

                var action = InputMap.GetActionForKey(input);

                if (action != null)
                {
                    action();
                }
            }
        }