mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 20:44:05 +09:00
new item type, "Dynamic Item"; working text terminal
Former-commit-id: 81e6d836f5f1e6490027d38146a32d404cf9ce3e Former-commit-id: af6557340f9cd0ea0b67eb7a8825aeffe75f9d82
This commit is contained in:
35
src/net/torvald/terrarum/gameworld/MapPoint.kt
Normal file
35
src/net/torvald/terrarum/gameworld/MapPoint.kt
Normal file
@@ -0,0 +1,35 @@
|
||||
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())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user