BaseContainer

abstract class BaseContainer<T>(source)

以字符串 ID 存储实体的基础容器。 Base registry of entities keyed by string ID.

所有公开操作均同步;列表与映射读取返回快照,而非可修改的内部存储。 Public operations are synchronized; list and map reads return snapshots, not mutable internal storage.

Inheritors

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard

清空当前容器。 / Clears this registry.

Link copied to clipboard
fun get(key: String): T?

按 ID 查找实体;不存在时返回 null。 / Looks up an entity by ID, or returns null.

Link copied to clipboard

返回 ID 到实体的映射快照。 / Returns a snapshot of the ID-to-entity map.

Link copied to clipboard

返回已注册 ID 的快照。 / Returns a snapshot of registered IDs.

Link copied to clipboard
fun put(key: String, value: T)

按 ID 注册或替换实体。 / Registers or replaces an entity by ID.

Link copied to clipboard

返回实体列表快照。 / Returns a snapshot of the entities.