ResourceRegistry class
Constructors
- ResourceRegistry({required World world})
Properties
-
debugIdToType
→ Map<
ResourceId, Type> -
Debug-only: mapping of ResourceId to registered type.
no setter
-
debugRegisteredTypes
→ Iterable<
Type> -
Debug-only: all registered resource types (includes absent resources).
no setter
-
debugTypeToId
→ Map<
Type, ResourceId> -
Debug-only: mapping of resource type to assigned ResourceId.
no setter
- doesNeedFlush → bool
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- pendingPushCount → int
-
no setter
- pendingRemoveCount → int
-
no setter
- revision → int
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- world → World
-
final
Methods
-
clear(
) → void -
ensureFlushed(
) → void - Conditionally flushes resources if any pending changes exist.
-
flush(
) → void -
flushToRemove(
) → void -
flushToUpsert(
) → void -
getByIdOrThrow<
T extends Resource> (ResourceId id) → T - Gets a resource by ResourceId for O(1) direct access (throws if not found).
-
getByType(
Type type) → Resource? - Gets a resource by runtime Type.
-
getResourceId<
T extends Resource> () → ResourceId? - Gets the ResourceId for a given resource type.
-
getType(
ResourceId id) → Type? - Gets the Type for a given ResourceId.
-
has<
T extends Resource> () → bool -
Check if a resource of type
Texists without throwing. -
hasByType(
Type type) → bool - Check if a resource exists by runtime Type.
-
iter<
T extends Resource> () → Iterable< T> -
iterDense(
) → Iterable< Resource> - Dense iteration over all active resources (skips null holes).
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
push<
T extends Resource> (T resource) → void -
pushByType(
Type type, Resource resource) → void - Push a resource using a runtime Type instead of a generic parameter.
-
remove<
T extends Resource> () → void -
removeByType(
Type type) → void - Remove resource by runtime type (for use in command execution)
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited