Skip to content

RecordCollection

class RecordCollection<T : Any>
Example
import rift.ecs.Persist
import rift.ecs.Persistent
@Persistent class Visits(@Persist val count: Int = 0)
on_login { player ->
val visits = Game.worldRecords.collection<Visits>()
val key = player.uuid.toString()
visits.put(key, Visits((visits.get(key)?.count ?: 0) + 1))
}
fun get(key: String): T?
fun contains(key: String): Boolean
fun keys(): List<String>
fun put(
key: String,
value: T
)
fun delete(key: String): Boolean
fun readAll(): RecordsRead<T>