mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-17 05:54:05 +09:00
new debugging tool ActorValueTracker
Former-commit-id: f30d2a859521082609425722edb91d3c366fbc58 Former-commit-id: 1486ad6b0a85415124c87522f07c012d4a335567
This commit is contained in:
@@ -22,11 +22,11 @@ abstract class Actor : Comparable<Actor>, Runnable {
|
||||
|
||||
override fun equals(other: Any?) = referenceID == (other as Actor).referenceID
|
||||
override fun hashCode() = referenceID
|
||||
override fun toString() = "Actor, " +
|
||||
override fun toString() =
|
||||
if (actorValue.getAsString(AVKey.NAME).isNullOrEmpty())
|
||||
"ID: ${hashCode()}"
|
||||
"${hashCode()}"
|
||||
else
|
||||
"ID: ${hashCode()} (${actorValue.getAsString(AVKey.NAME)})"
|
||||
"${hashCode()} (${actorValue.getAsString(AVKey.NAME)})"
|
||||
override fun compareTo(other: Actor): Int = (this.referenceID - other.referenceID).sign()
|
||||
|
||||
fun Int.sign(): Int = if (this > 0) 1 else if (this < 0) -1 else 0
|
||||
|
||||
Reference in New Issue
Block a user