public void AdditionOperationWillNotGoOverMinValue() { var number = new ClampFloat(10.0f, 5.0f, 12.0f); number += -10.10f; Assert.That((float)number, Is.EqualTo(5.0f)); }
public void CanConverClamtFloatImplicityToAFloat() { var clamp = new ClampFloat(); float zero = clamp; Assert.That(zero, Is.EqualTo(0.0f)); }
public ArcBallCamera(Vector3 target, ClampFloat rotationX, ClampFloat rotationY, ClampFloat distance, GraphicsDevice graphicsDevice) : base(graphicsDevice, target) { Target = target; RotationY = rotationY; RotationX = rotationX; Distance = distance; }
public void CanIntializeWithJustAValue() { var clamp = new ClampFloat(1.0f); Assert.That((float)clamp, Is.EqualTo(1.0f)); }
public void WhenTheNumberIsSetItIsClamped() { var number = new ClampFloat(17, 5, 25); number.Value = 32; Assert.That(number.Value, Is.EqualTo(25)); }
public void ManyAddsKeepTheNumberAtMax() { var number = new ClampFloat(0.0f, 0.0f, 12.0f); for (var i = 0; i < 15; i++) number += 1.0f; Assert.That((float)number, Is.EqualTo(12.0f)); }
public void Rotate(float rotationXChange, float rotationYChange) { RotationX += rotationXChange; RotationY += -rotationYChange; }
public bool Equals(ClampFloat other) { if (ReferenceEquals(null, other)) return false; return ReferenceEquals(this, other) || other.Value.Equals(Value); }