Esempio n. 1
0
        public WhenProcessingInput()
        {
            _input = new InputDouble();
            var map = new Stage1().LoadMap();

            _renderer             = new Renderer(map);
            _renderer.ClearScreen = () => { };
            _player = new Player(new Location(5, 5));

            _engine = new GameEngineBuilder()
                      .WithInput(_input)
                      .WithRenderer(_renderer)
                      .WithPlayer(_player)
                      .Build();
        }
Esempio n. 2
0
        public void ThenItRendersThePlayer()
        {
            var map      = new Stage1().LoadMap();
            var input    = new InputDouble();
            var renderer = new RendererDouble(map);

            var engine = new GameEngineBuilder()
                         .WithInput(input)
                         .WithRenderer(renderer)
                         .WithPlayer(new Player(5, 5))
                         .Build();

            input.SendInput(InputResult.East);

            renderer
            .Output[4]
            .Should()
            .Contain(RenderableFactory.PLAYER_REPRESENTATION.ToString());
        }
Esempio n. 3
0
        public GameEngineBuilder WithInput(InputDouble input)
        {
            _input = input;

            return(this);
        }