public InRange ( |
||
otherPos | ||
range | int | |
Résultat | bool |
public bool InRange(Position otherPos, int range)
{
return this.InRange(otherPos.X, otherPos.Y, range);
}
Position::InRange ( int x, int y, int range ) : bool |
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)); }