コード例 #1
0
ファイル: InputHudView.cs プロジェクト: zakvdm/Frenetic
        public InputOverlayView(InputLine inputLine, Rectangle inputWindow, IFont font)
        {
            _inputLine = inputLine;
            this.Window = inputWindow;
            _font = font;

            this.BackgroundColor = OverlaySetView.BACKGROUND_COLOR;
        }
コード例 #2
0
        public void DrawsCurrentInput()
        {
            InputLine inputLine = new InputLine();
            inputLine.CurrentInput = "Hey there";
            InputOverlayView hudView = new InputOverlayView(inputLine, rectangle, stubFont);

            hudView.Draw(stubSpriteBatch);

            stubSpriteBatch.AssertWasCalled(x => x.DrawText(Arg<IFont>.Is.Equal(stubFont), Arg<string>.Is.Equal(InputOverlayView.CursorText + "Hey there"), Arg<Vector2>.Is.Equal(new Vector2(rectangle.Left + OverlaySetView.TEXT_OFFSET.X, rectangle.Bottom - OverlaySetView.TEXT_OFFSET.Y)), Arg<Color>.Is.Anything, Arg<float>.Is.Anything));
        }
コード例 #3
0
        public void SetUp()
        {
            inputLine = new InputLine();
            stubCommandConsole = MockRepository.GenerateStub<ICommandConsole>();
            stubMessageConsole = MockRepository.GenerateStub<IMessageConsole>();
            stubInputView = MockRepository.GenerateStub<IOverlayView>();
            stubCommandConsoleView = MockRepository.GenerateStub<IOverlayView>();
            stubMessageConsoleView = MockRepository.GenerateStub<IOverlayView>();
            stubPossibleCommandsView = MockRepository.GenerateStub<IOverlayView>();
            stubKeyboard = MockRepository.GenerateStub<IKeyboard>();

            consoleController = new ConsoleController(inputLine, stubCommandConsole, stubMessageConsole, stubInputView, stubCommandConsoleView, stubMessageConsoleView, stubPossibleCommandsView, stubKeyboard);
        }
コード例 #4
0
ファイル: ConsoleController.cs プロジェクト: zakvdm/Frenetic
        public ConsoleController(InputLine inputLine, ICommandConsole commandConsole, IMessageConsole messageConsole, 
            IOverlayView inputView, IOverlayView commandConsoleView, IOverlayView messageConsoleView, IOverlayView possibleCommandsView, IKeyboard keyboard)
        {
            this.InputLine = inputLine;
            _commandConsole = commandConsole;
            _messageConsole = messageConsole;
            _inputView = inputView;
            _commandConsoleView = commandConsoleView;
            _messageConsoleView = messageConsoleView;
            _possibleCommandsView = possibleCommandsView;
            _keyboard = keyboard;

            this.InputLine.CurrentInput = "";
        }