Exemple #1
0
        public void ResultGetter_ReturnsValueSetThroughConstructor()
        {
            var moveCommand        = new MoveCommand(1, 0, 1, 1);
            var inputProcessResult = new DroneControllerKeyInputProcessResult(moveCommand);

            Assert.Equal(moveCommand, inputProcessResult.Result);
        }
Exemple #2
0
        /// <summary>
        /// Processes a key input.
        /// </summary>
        /// <param name="keyInfo">The key input to evaluate.</param>
        /// <returns>The evaluation result of the <paramref name="keyInfo"/>.</returns>
        public InputProcessResult ProcessKeyInput(KeyInfo keyInfo)
        {
            DroneCommand keyEvaluated = this.keyInputEvaluator.EvaluateKey(keyInfo);

            if (keyEvaluated == null)
            {
                return(null);
            }

            this.LatestKeyInputEvaluated = keyEvaluated;
            DroneControllerKeyInputProcessResult result =
                new DroneControllerKeyInputProcessResult(this.LatestKeyInputEvaluated.Copy());

            this.Control();
            return(result);
        }