public void TestVictorSet() { using (Victor t = new Victor(2)) { t.Set(1); Assert.AreEqual(t.Get(), 1); } }
public void TestVictorStarts0() { using (Victor t = new Victor(2)) { Assert.AreEqual(t.Get(), 0); } }
public void TestPIDWrite() { using (Victor t = new Victor(2)) { t.PidWrite(-1); Assert.AreEqual(t.Get(), -1); } }
public bool Collision(Victor victor) { foreach (var rectangleVictor in victor.Rectangle) { if (_destinationRectangle.Intersects(rectangleVictor)) return true; } return false; }
public void TestPWMHelpers() { using (Victor t = new Victor(2)) { t.Set(1); Assert.AreEqual(PWMHelpers.ReverseByType(nameof(Victor), HalData()["pwm"][2]["raw_value"]), 1); Assert.AreEqual(PWMHelpers.ReverseByType(2), 1); Assert.AreEqual(HalData()["pwm"][2]["value"], 1); } }
public bool AuDessus(Victor victor) { if (victor.Position.Y + victor.Texture.Height - 20 < this.DestinationRectangle.Y) { if ((victor.Position.X - victor.Texture.Width / 8 + 60 > this.DestinationRectangle.X && victor.Position.X - victor.Texture.Width / 8 + 20 < this.DestinationRectangle.X + this.DestinationRectangle.Width) || (victor.Position.X < this.DestinationRectangle.X + this.DestinationRectangle.Width && victor.Position.X > this.DestinationRectangle.X)) { return true; } else return false; } else { return false; } }
public void TestVictorInitialized() { using (Victor t = new Victor(2)) Assert.AreEqual(HalData()["pwm"][2]["type"], "victor"); }