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)); }
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)); }
public static Query GetCurrentQuery() { return(PressedKeyConverter.Convert(KeyPressed)); }