C# Класс Aura.Channel.World.Position

Describes the current position of an entity.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
X int
Y int

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
GetRandom ( int distance, Random rnd ) : Position

Returns random position in radius around this position.

Описание методов

Equals() публичный Метод

public Equals ( object obj ) : bool
obj object
Результат bool

GetDirection() публичный Метод

Returns direction the other position is in as radian.
public GetDirection ( Position otherPos ) : float
otherPos Position
Результат float

GetDistance() публичный Метод

Returns distance between this and another position.
public GetDistance ( Position otherPos ) : int
otherPos Position
Результат int

GetHashCode() публичный Метод

public GetHashCode ( ) : int
Результат int

GetRandomInRange() публичный Метод

Returns random position in radius around this position.
public GetRandomInRange ( int radius, Random rnd ) : Position
radius int
rnd System.Random
Результат Position

GetRandomInRange() публичный Метод

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
Результат Position

GetRandomInRect() публичный Метод

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
Результат Position

GetRelative() публичный Метод

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
Результат Position

GetRelative() публичный Метод

Returns position in direction and distance.
public GetRelative ( double radian, int distance ) : Position
radian double
distance int
Результат Position

InCone() публичный Метод

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.
Результат bool

InPolygon() публичный Метод

Returns whether the position is inside the given points.
public InPolygon ( ) : bool
Результат bool

InRange() публичный Метод

Returns true if the other position is within range.
public InRange ( Position otherPos, int range ) : bool
otherPos Position
range int
Результат bool

InRange() публичный Метод

Returns true if the other position is within range.
public InRange ( int x, int y, int range ) : bool
x int
y int
range int
Результат bool

Position() публичный Метод

public Position ( Position pos ) : System
pos Position
Результат System

Position() публичный Метод

public Position ( int x, int y ) : System
x int
y int
Результат System

Position() публичный Метод

New Position based on location id (i.e. 0x3000RRRRXXXXYYYY).
public Position ( long locationId ) : System
locationId long
Результат System

ToString() публичный Метод

public ToString ( ) : string
Результат string

operator() публичный статический Метод

public static operator ( ) : bool
Результат bool

Описание свойств

X публичное свойство

public int X
Результат int

Y публичное свойство

public int Y
Результат int