mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-19 23:14:05 +09:00
gson test in progress
This commit is contained in:
@@ -35,7 +35,7 @@ abstract class Actor(val renderOrder: RenderOrder) : Comparable<Actor>, Runnable
|
||||
* @return Reference ID. (16777216-0x7FFF_FFFF)
|
||||
*/
|
||||
open var referenceID: ActorID? = null
|
||||
var actorValue = ActorValue(this)
|
||||
var actorValue = ActorValue(this) // FIXME cyclic reference on GSON
|
||||
@Volatile var flagDespawn = false
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
|
||||
@@ -5,7 +5,7 @@ import net.torvald.terrarum.KVHashMap
|
||||
/**
|
||||
* Created by minjaesong on 2017-04-28.
|
||||
*/
|
||||
class ActorValue(val actor: Actor) : KVHashMap() {
|
||||
class ActorValue(@Transient val actor: Actor) : KVHashMap() {
|
||||
|
||||
private constructor(actor: Actor, newMap: HashMap<String, Any>): this(actor) {
|
||||
hashMap = newMap
|
||||
|
||||
@@ -32,7 +32,7 @@ open class ActorWBMovable(renderOrder: RenderOrder, val immobileBody: Boolean =
|
||||
ActorWithBody(renderOrder) {
|
||||
|
||||
|
||||
val COLLISION_TEST_MODE = false
|
||||
@Transient val COLLISION_TEST_MODE = false
|
||||
|
||||
/* !! ActorValue macros are on the very bottom of the source !! */
|
||||
|
||||
@@ -1155,15 +1155,15 @@ open class ActorWBMovable(renderOrder: RenderOrder, val immobileBody: Boolean =
|
||||
}
|
||||
}*/
|
||||
|
||||
private inline val submergedRatio: Double
|
||||
private val submergedRatio: Double
|
||||
get() {
|
||||
if (hitbox.height == 0.0) throw RuntimeException("Hitbox.height is zero")
|
||||
return submergedHeight / hitbox.height
|
||||
}
|
||||
private inline val submergedVolume: Double
|
||||
private val submergedVolume: Double
|
||||
get() = submergedHeight * hitbox.width * hitbox.width
|
||||
|
||||
private inline val submergedHeight: Double
|
||||
private val submergedHeight: Double
|
||||
get() = Math.max(
|
||||
getContactingAreaFluid(COLLIDING_LEFT),
|
||||
getContactingAreaFluid(COLLIDING_RIGHT)
|
||||
|
||||
Reference in New Issue
Block a user