コード例 #1
0
ファイル: GameState.cs プロジェクト: TheDoctorTimeLord/gmT
 public GameState()
 {
     PressedKeyConverter.CreateConverter(new Dictionary <Keys, Query>
     {
         { Keys.D, Query.RotateRight },
         { Keys.W, Query.Move },
         { Keys.A, Query.RotateLeft },
         { Keys.E, Query.Interaction }
     });
 }
コード例 #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));
        }
コード例 #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));
        }