ConsoleGameEngine
1.1.0
jvm
ConsoleGameEngine
/
top.kmar.game.map
/
Rect2D
Rect2D
data
class
Rect2D
(
val
x
:
Int
,
val
y
:
Int
,
val
width
:
Int
,
val
height
:
Int
)
:
Comparable
<
Rect2D
>
用于表示一个矩形区域
Members
Constructors
Rect2D
Link copied to clipboard
constructor
(
x
:
Int
,
y
:
Int
,
width
:
Int
,
height
:
Int
)
Types
Companion
Link copied to clipboard
object
Companion
Functions
compare
To
Link copied to clipboard
open
operator override
fun
compareTo
(
other
:
Rect2D
)
:
Int
contains
X
Link copied to clipboard
fun
containsX
(
x
:
Int
)
:
Boolean
contains
Y
Link copied to clipboard
fun
containsY
(
y
:
Int
)
:
Boolean
has
Intersection
Link copied to clipboard
fun
hasIntersection
(
that
:
Rect2D
)
:
Boolean
判断是否存在交集
intersect
Link copied to clipboard
fun
intersect
(
that
:
Rect2D
)
:
Rect2D
与指定矩形求交集。
map
To
Entity
Link copied to clipboard
fun
mapToEntity
(
entity
:
GEntity
)
:
Rect2D
将相对于地图的全局坐标映射到相对于实体的区域坐标
Properties
bottom
Link copied to clipboard
val
bottom
:
Int
下边界
height
Link copied to clipboard
val
height
:
Int
is
Empty
Link copied to clipboard
val
isEmpty
:
Boolean
right
Link copied to clipboard
val
right
:
Int
右边界
width
Link copied to clipboard
val
width
:
Int
x
Link copied to clipboard
val
x
:
Int
y
Link copied to clipboard
val
y
:
Int