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:
Song Minjae
2017-04-17 02:18:52 +09:00
parent 6087072d3d
commit f2ae2d9449
40 changed files with 502 additions and 249 deletions

View File

@@ -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)
}
}