메소드 | 설명 | |
---|---|---|
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 |
메소드 | 설명 | |
---|---|---|
Coordinate ( ) : System | ||
GetAdjacents ( int distance ) : HashSet |
public Distance ( Coordinate coordinate ) : int | ||
coordinate | Coordinate | 要计算距离的坐标 |
리턴 | int |
public GetCoordinate ( Direction direction ) : Coordinate | ||
direction | Direction | |
리턴 | Coordinate |
public NearlyCoordinates ( int distance = 1 ) : Coordinate[] | ||
distance | int | 距离 |
리턴 | Coordinate[] |
public static Parse ( string expression ) : Coordinate | ||
expression | string | 包含坐标信息的字符串 |
리턴 | Coordinate |
public static RandomCoordinate ( int x, int y ) : Coordinate | ||
x | int | x取值范围 |
y | int | y取值范围 |
리턴 | Coordinate |
public static TryCreate ( int x, int y, Coordinate &coordinate ) : bool | ||
x | int | |
y | int | |
coordinate | Coordinate | |
리턴 | bool |