예제 #1
0
        private static void Main()
        {
            ICommandInputProvider commandInput = new CommandReader();
            IInfoInputProvider menuInput = new Menu();
            IInputProvider inputProvider = new ConsoleInputProvider(commandInput, menuInput);

            IInfoRenderer infoPanel = new InfoPanel();
            IPlayFieldRenderer playFieldPanel = new PlayFieldPanel();
            ILadderRenderer topScoresPanel = new TopScoresPanel();
            IRenderer consoleRenderer = new ConsoleRender(infoPanel, playFieldPanel, topScoresPanel);

            LabyrinthFacade.Start(consoleRenderer, inputProvider, FileLogger.Instance());
        }
        public void ClassInitialize()
        {
            playerPosition = new Position(3, 3);
            generator = new StandardPlayFieldGenerator(playerPosition, 9, 9);
            playField = new PlayField(generator, playerPosition, 9, 9);

            IInfoRenderer infoPanel = new InfoPanel();
            IPlayFieldRenderer playFieldPanel = new PlayFieldPanel();
            ILadderRenderer topScoresPanel = new TopScoresPanel();
            output = new ConsoleRender(infoPanel, playFieldPanel, topScoresPanel);

            memory = new MementoCaretaker(new List<IMemento>());

            ladder = ScoreLadder.Instance;

            player = new Player("test", new Cell(playerPosition));

            context = new CommandContext(playField, output, memory, ladder, player);
        }