InRange() public method

Returns true if the other position is within range.
public InRange ( Position otherPos, int range ) : bool
otherPos Position
range int
return bool
Ejemplo n.º 1
0
		public void InRange()
		{
			var pos1 = new Position(0, 0);
			var pos2 = new Position(0, 500);
			var pos4 = new Position(500, 500);
			var pos5 = new Position(-500, -500);

			Assert.Equal(true, pos1.InRange(pos2, 500));
			Assert.Equal(false, pos1.InRange(pos2, 499));
			Assert.Equal(true, pos4.InRange(pos5, 1415));
			Assert.Equal(false, pos4.InRange(pos5, 1413));
		}