mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 02:24:05 +09:00
fixes, bits and pieces, changes in ID referencing, terrain and wall takes damage, working test pickaxe, and a new issue
This commit is contained in:
@@ -3,6 +3,7 @@ package net.torvald.terrarum
|
||||
import com.google.gson.JsonPrimitive
|
||||
import java.util.*
|
||||
import java.util.function.Consumer
|
||||
import kotlin.collections.HashMap
|
||||
|
||||
typealias ActorValue = KVHashMap
|
||||
typealias ItemValue = KVHashMap
|
||||
@@ -13,7 +14,15 @@ typealias GameConfig = KVHashMap
|
||||
*/
|
||||
class KVHashMap {
|
||||
|
||||
private val hashMap = HashMap<String, Any>()
|
||||
constructor() {
|
||||
hashMap = HashMap<String, Any>()
|
||||
}
|
||||
|
||||
private constructor(newMap: HashMap<String, Any>) {
|
||||
hashMap = newMap
|
||||
}
|
||||
|
||||
private val hashMap: HashMap<String, Any>
|
||||
|
||||
/**
|
||||
* Add key-value pair to the configuration table.
|
||||
@@ -108,4 +117,9 @@ class KVHashMap {
|
||||
hashMap.remove(key, hashMap[key]!!)
|
||||
}
|
||||
|
||||
fun clone(): KVHashMap {
|
||||
val cloneOfMap = hashMap.clone() as HashMap<String, Any>
|
||||
return KVHashMap(cloneOfMap)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user