Beispiel #1
0
 public GameState()
 {
     PressedKeyConverter.CreateConverter(new Dictionary <Keys, Query>
     {
         { Keys.D, Query.RotateRight },
         { Keys.W, Query.Move },
         { Keys.A, Query.RotateLeft },
         { Keys.E, Query.Interaction }
     });
 }
Beispiel #2
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));
        }
Beispiel #3
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));
        }
Beispiel #4
0
 public static Query GetCurrentQuery()
 {
     return(PressedKeyConverter.Convert(KeyPressed));
 }