loading player from json file

This commit is contained in:
minjaesong
2021-08-28 16:31:06 +09:00
parent 29cccea19b
commit b84a0a770b
31 changed files with 308 additions and 145 deletions

View File

@@ -5,7 +5,15 @@ import org.dyn4j.geometry.Vector2
/**
* Created by minjaesong on 2016-01-15.
*/
data class Point2d(var x: Double, var y: Double) : Cloneable {
class Point2d() : Cloneable {
var x: Double = 0.0
var y: Double = 0.0
constructor(x: Double, y: Double) : this() {
this.x = x
this.y = y
}
override fun toString(): String {
return "($x, $y)"
@@ -66,9 +74,21 @@ data class Point2d(var x: Double, var y: Double) : Cloneable {
return this
}
operator fun component1() = x
operator fun component2() = y
}
data class Point2i(var x: Int, var y: Int) {
class Point2i() {
var x: Int = 0
var y: Int = 0
constructor(x: Int, y: Int) : this() {
this.x = x
this.y = y
}
fun set(x: Int, y: Int) {
this.x = x
this.y = y
@@ -94,4 +114,7 @@ data class Point2i(var x: Int, var y: Int) {
return this
}
operator fun component1() = x
operator fun component2() = y
}