Files
Terrarum/src/net/torvald/terrarum/gameworld/MapPoint.kt
Song Minjae d8b70887a9 new item type, "Dynamic Item"; working text terminal
Former-commit-id: 81e6d836f5f1e6490027d38146a32d404cf9ce3e
Former-commit-id: af6557340f9cd0ea0b67eb7a8825aeffe75f9d82
2016-09-10 16:45:04 +09:00

36 lines
707 B
Kotlin

package net.torvald.terrarum.gameworld
import net.torvald.point.Point2d
import java.io.Serializable
class MapPoint {
var startPoint: Point2d? = null
private set
var endPoint: Point2d? = null
private set
constructor() {
}
constructor(p1: Point2d, p2: Point2d) {
setPoint(p1, p2)
}
constructor(x1: Int, y1: Int, x2: Int, y2: Int) {
setPoint(x1, y1, x2, y2)
}
fun setPoint(p1: Point2d, p2: Point2d) {
startPoint = p1
endPoint = p2
}
fun setPoint(x1: Int, y1: Int, x2: Int, y2: Int) {
startPoint = Point2d(x1.toDouble(), y1.toDouble())
endPoint = Point2d(x2.toDouble(), y2.toDouble())
}
}