1package org.jire.runehiveps.objectexamines
3import com.google.gson.Gson
4import com.google.gson.GsonBuilder
5import com.runehive.Config
6import it.unimi.dsi.fastutil.ints.Int2ObjectMap
7import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap
8import java.nio.file.Path
9import kotlin.io.path.bufferedReader
14object ObjectExamines {
16 private val defaultFilePath: Path = Path.of(
19 "object_examines.json"
23 val map: Int2ObjectMap<String> = Int2ObjectOpenHashMap()
27 fun loadObjectExamines(
28 filePath: Path = defaultFilePath,
29 gson: Gson = GsonBuilder()
33 val examines: Array<ObjectExamine> =
34 gson.fromJson(filePath.bufferedReader(), Array<ObjectExamine>::class.java)
35 for (examine in examines) {
36 map.put(examine.id, examine.examine.replace("%SERVER_NAME%", Config.SERVER_NAME))