Collection beta
Interface of @v12-engine/engine
ts
export interface Collection<T>Definitions of one kind, by id: what a mod adds, changes or takes out
Members
add
ts
add(def: T): void;Throws when there is one of that id already: that is override
all
ts
all(): readonly T[];Every definition in the collection, in order
get
ts
get(id: string): T | undefined;Finds the definition with this id; undefined when there is none
has
ts
has(id: string): boolean;Whether a definition with this id is there
override
ts
override(id: string, change: Partial<T> | ((def: T) => T)): void;Changes one that is there: a new definition, or the fields that are different. Throws when there is none
remove
ts
remove(id: string): void;Throws when there is none of that id