Dict

gdext.builtin.Dict
See theDict companion object
final class Dict[K, V] extends AutoCloseable

A typed view over Godot's Dictionary — Dict[K, V]. Keys and values marshal through the ToVariant/FromVariant seam, so any builtin- or (where a given exists) object-convertible K/V works.

The backing 8-byte Dictionary handle is heap-owned so a Dict can live in a class field (an exported property) for the object's lifetime. As with the rest of the binding, freeing is explicit / process-lifetime (Phase 4 lifetimes).

Attributes

Companion
object
Graph
Supertypes
trait AutoCloseable
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def apply(key: K): V
def close(): Unit
def free(): Unit

Release this handle's reference to the engine Dictionary and its storage. Idempotent; any later use throws. An exported Dict property is released by the binding when the property is overwritten or the instance is freed.

Release this handle's reference to the engine Dictionary and its storage. Idempotent; any later use throws. An exported Dict property is released by the binding when the property is overwritten or the instance is freed.

Attributes

def put(key: K, value: V): Unit
def size: Int