Ejemplo n.º 1
0
        public MessageInputHandler(WorldInstance worldInstance, MessageRendererState messageRendererState, TimeSpan totalTime, Action<IXnaGameTime> messageClosingDelegate)
        {
            worldInstance.ThrowIfNull("worldInstance");
            messageRendererState.ThrowIfNull("messageRendererState");
            messageClosingDelegate.ThrowIfNull("messageClosingDelegate");

            _worldInstance = worldInstance;
            _messageRendererState = messageRendererState;
            _messageClosingDelegate = messageClosingDelegate;
            _answerKeyboardStateHelper = new KeyboardStateHelper(
                KeyDown,
                null,
                null,
                TextAdventure.Xna.Constants.MessageRenderer.Input.AcceptKey,
                TextAdventure.Xna.Constants.MessageRenderer.Input.NextAnswerKey,
                TextAdventure.Xna.Constants.MessageRenderer.Input.PreviousAnswerKey);
            _scrollKeyboardStateHelper = new KeyboardStateHelper(
                _scrollKeyboardRepeatHelper,
                TextAdventure.Xna.Constants.MessageRenderer.Input.ScrollUpKey,
                TextAdventure.Xna.Constants.MessageRenderer.Input.ScrollDownKey,
                TextAdventure.Xna.Constants.MessageRenderer.Input.HomeKey,
                TextAdventure.Xna.Constants.MessageRenderer.Input.EndKey,
                TextAdventure.Xna.Constants.MessageRenderer.Input.PageUpKey,
                TextAdventure.Xna.Constants.MessageRenderer.Input.PageDownKey);
            _scrollKeyboardRepeatHelper.InitialInterval = TextAdventure.Xna.Constants.MessageRenderer.Input.ScrollKeyboardInterval;
            _scrollKeyboardRepeatHelper.RepeatingInterval = TextAdventure.Xna.Constants.MessageRenderer.Input.ScrollKeyboardInterval;
        }
Ejemplo n.º 2
0
        public PlayerInputHandler(WorldInstance worldInstance)
        {
            worldInstance.ThrowIfNull("worldInstance");

            _worldInstance = worldInstance;
            _keyboardStateHelper = new KeyboardStateHelper(
                _keyboardRepeatHelper,
                Constants.PlayerRenderer.Input.MoveUpKey,
                Constants.PlayerRenderer.Input.MoveDownKey,
                Constants.PlayerRenderer.Input.MoveLeftKey,
                Constants.PlayerRenderer.Input.MoveRightKey);
        }
        public WorldTimeInputHandler(WorldTimeRendererState worldTimeRendererState)
        {
            worldTimeRendererState.ThrowIfNull("worldTimeRenderer");

            _worldTimeRendererState = worldTimeRendererState;
            _keyboardStateHelper = new KeyboardStateHelper(
                KeyDown,
                null,
                null,
                Constants.WorldTimeRenderer.Input.PauseKey,
                Constants.WorldTimeRenderer.Input.FasterKey,
                Constants.WorldTimeRenderer.Input.SlowerKey);
        }