Method | Description | |
---|---|---|
Create ( int x, int y ) : Coordinate |
创建一个坐标对象
|
|
Distance ( Coordinate coordinate ) : int |
计算与另一个坐标的距离
|
|
Equals ( object obj ) : bool | ||
GetCoordinate ( Direction direction ) : Coordinate | ||
GetHashCode ( ) : int | ||
NearlyCoordinates ( int distance = 1 ) : Coordinate[] |
获取临近的坐标
|
|
Parse ( string expression ) : Coordinate |
从字符串中解析出坐标信息
|
|
RandomCoordinate ( int x, int y ) : Coordinate |
取一个不超出指定范围的随机坐标
|
|
ToString ( ) : string |
将坐标转换为字符串形式
|
|
TryCreate ( int x, int y, Coordinate &coordinate ) : bool |
尝试创建坐标对象
|
|
operator ( ) : Coordinate |
计算两个坐标相加后的结果
|
|
operator ( ) : bool |
Method | Description | |
---|---|---|
Coordinate ( ) : System | ||
GetAdjacents ( int distance ) : HashSet |
public static Create ( int x, int y ) : Coordinate | ||
x | int | |
y | int | |
return | Coordinate |
public Distance ( Coordinate coordinate ) : int | ||
coordinate | Coordinate | 要计算距离的坐标 |
return | int |
public GetCoordinate ( Direction direction ) : Coordinate | ||
direction | Direction | |
return | Coordinate |
public NearlyCoordinates ( int distance = 1 ) : Coordinate[] | ||
distance | int | 距离 |
return | Coordinate[] |
public static Parse ( string expression ) : Coordinate | ||
expression | string | 包含坐标信息的字符串 |
return | Coordinate |
public static RandomCoordinate ( int x, int y ) : Coordinate | ||
x | int | x取值范围 |
y | int | y取值范围 |
return | Coordinate |
public static TryCreate ( int x, int y, Coordinate &coordinate ) : bool | ||
x | int | |
y | int | |
coordinate | Coordinate | |
return | bool |