C# Class Aura.Channel.World.Position

Describes the current position of an entity.
Mostrar archivo Open project: aura-project/aura Class Usage Examples

Public Properties

Property Type Description
X int
Y int

Public Methods

Method Description
Equals ( object obj ) : bool
GetDirection ( Position otherPos ) : float

Returns direction the other position is in as radian.

GetDistance ( Position otherPos ) : int

Returns distance between this and another position.

GetHashCode ( ) : int
GetRandomInRange ( int radius, Random rnd ) : Position

Returns random position in radius around this position.

GetRandomInRange ( int distanceMin, int distanceMax, Random rnd ) : Position

Returns random position around this position, not nearer than min, and not further than max.

GetRandomInRect ( int width, int height, Random rnd ) : Position

Returns random position in rect, centered on this position.

GetRelative ( Position other, int distance ) : Position

Returns position on the line between position and other.

When you knock someone back, he gets pushed in the opposite direction. The other position would be the enemy, the distance the amount how far to push him away. A negative distance will return a position between you two.

GetRelative ( double radian, int distance ) : Position

Returns position in direction and distance.

InCone ( Position tip, double direction, int radius, double angle ) : bool

Returns true if this position is in a cone, based on the parameters.

InPolygon ( ) : bool

Returns whether the position is inside the given points.

InRange ( Position otherPos, int range ) : bool

Returns true if the other position is within range.

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

Returns true if the other position is within range.

Position ( Position pos ) : System
Position ( int x, int y ) : System
Position ( long locationId ) : System

New Position based on location id (i.e. 0x3000RRRRXXXXYYYY).

ToString ( ) : string
operator ( ) : bool

Private Methods

Method Description
GetRandom ( int distance, Random rnd ) : Position

Returns random position in radius around this position.

Method Details

Equals() public method

public Equals ( object obj ) : bool
obj object
return bool

GetDirection() public method

Returns direction the other position is in as radian.
public GetDirection ( Position otherPos ) : float
otherPos Position
return float

GetDistance() public method

Returns distance between this and another position.
public GetDistance ( Position otherPos ) : int
otherPos Position
return int

GetHashCode() public method

public GetHashCode ( ) : int
return int

GetRandomInRange() public method

Returns random position in radius around this position.
public GetRandomInRange ( int radius, Random rnd ) : Position
radius int
rnd System.Random
return Position

GetRandomInRange() public method

Returns random position around this position, not nearer than min, and not further than max.
public GetRandomInRange ( int distanceMin, int distanceMax, Random rnd ) : Position
distanceMin int
distanceMax int
rnd System.Random
return Position

GetRandomInRect() public method

Returns random position in rect, centered on this position.
public GetRandomInRect ( int width, int height, Random rnd ) : Position
width int
height int
rnd System.Random
return Position

GetRelative() public method

Returns position on the line between position and other.
When you knock someone back, he gets pushed in the opposite direction. The other position would be the enemy, the distance the amount how far to push him away. A negative distance will return a position between you two.
public GetRelative ( Position other, int distance ) : Position
other Position
distance int
return Position

GetRelative() public method

Returns position in direction and distance.
public GetRelative ( double radian, int distance ) : Position
radian double
distance int
return Position

InCone() public method

Returns true if this position is in a cone, based on the parameters.
public InCone ( Position tip, double direction, int radius, double angle ) : bool
tip Position Tip of the cone.
direction double Cone's direction as radian.
radius int Cone's radius.
angle double Cone's angle as radian.
return bool

InPolygon() public method

Returns whether the position is inside the given points.
public InPolygon ( ) : bool
return bool

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

InRange() public method

Returns true if the other position is within range.
public InRange ( int x, int y, int range ) : bool
x int
y int
range int
return bool

Position() public method

public Position ( Position pos ) : System
pos Position
return System

Position() public method

public Position ( int x, int y ) : System
x int
y int
return System

Position() public method

New Position based on location id (i.e. 0x3000RRRRXXXXYYYY).
public Position ( long locationId ) : System
locationId long
return System

ToString() public method

public ToString ( ) : string
return string

operator() public static method

public static operator ( ) : bool
return bool

Property Details

X public_oe property

public int X
return int

Y public_oe property

public int Y
return int