Skip to content

ArchieStorageMap

class ArchieStorageMap<T : UpdateManager<NbtTag>> : Iterable<Map.Entry<String, T>> 

A dynamically-sized, key-ordered map of storage-like UpdateManagers (e.g. net.kernelpanicsoft.archie.transfer.ArchieItemStorage), declared via NBTHolder.itemMapField/fluidMapField/energyMapField. Unlike NestedNBTHolderMap, every entry shares the same shape (size/limit/capacity), fixed once at field declaration, so factory is supplied once here rather than per getOrPut call.

Properties

keys

val keys: Set<String>

size

val size: Int

Functions

clear

fun clear()

containsKey

get

operator fun get(key: String): T?

getOrPut

fun getOrPut(key: String): T

Returns the existing storage at key, or builds one via factory, stores it, and marks this dirty.

iterator

open operator override fun iterator(): Iterator<Map.Entry<String, T>>

remove

fun remove(key: String): T?

Removes and returns the storage at key, marking this dirty - null if it wasn't present.