Aura.Channel.World.Position.InRange C# (CSharp) Method

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

Same methods

Position::InRange ( int x, int y, int range ) : bool

Usage Example

コード例 #1
0
ファイル: Position.cs プロジェクト: aura-project/aura
		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));
		}