public InputOverlayView(InputLine inputLine, Rectangle inputWindow, IFont font) { _inputLine = inputLine; this.Window = inputWindow; _font = font; this.BackgroundColor = OverlaySetView.BACKGROUND_COLOR; }
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)); }
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); }
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 = ""; }