예제 #1
0
        public void TestChangingMatching()
        {
            PressedKeyConverter.CreateConverter(new Dictionary <Keys, Query>
            {
                { Keys.D, Query.RotateRight },
                { Keys.W, Query.Move },
                { Keys.A, Query.RotateLeft },
                { Keys.E, Query.Interaction }
            });

            Assert.AreEqual(Query.Move, PressedKeyConverter.Convert(Keys.W));
            PressedKeyConverter.ChangeMatching(Keys.Up, Query.Move);
            Assert.AreEqual(Query.Move, PressedKeyConverter.Convert(Keys.Up));
        }
예제 #2
0
        public void TestConverter()
        {
            PressedKeyConverter.CreateConverter(new Dictionary <Keys, Query>
            {
                { Keys.D, Query.RotateRight },
                { Keys.W, Query.Move },
                { Keys.A, Query.RotateLeft },
                { Keys.E, Query.Interaction }
            });

            Assert.AreEqual(Query.RotateRight, PressedKeyConverter.Convert(Keys.D));
            Assert.AreEqual(Query.Move, PressedKeyConverter.Convert(Keys.W));
            Assert.AreEqual(Query.RotateLeft, PressedKeyConverter.Convert(Keys.A));
            Assert.AreEqual(Query.Interaction, PressedKeyConverter.Convert(Keys.E));
        }
예제 #3
0
 public static Query GetCurrentQuery()
 {
     return(PressedKeyConverter.Convert(KeyPressed));
 }