Pending
The Pending
class represents a pending state with removed, updated, and created states. It keeps track of changes made to actors, entities, and components.
Example Usage
Methods
constructor(isDiffed: boolean = false)
: Constructs a newPending
object and resets its state.actorInput(id: string, index: number): void
: Adds an actor input to the created inputs state.changeComponent(pendingType: string, id: string, key: string): void
: Changes a component in the specified pending state.createEntity(id: string): void
: Marks an entity as created in the created state.removeActor(id: string): void
: Marks an actor as removed in the removed state.removeComponent(id: string, key: string): void
: Marks a component as removed in the removed state.removeEntity(id: string): void
: Marks an entity as removed in the removed state.reset(): void
: Resets the state of thePending
object.spawnActor(id: string): void
: Marks an actor as spawned in the created state.upsertComponent(pendingType: string, id: string, key: string): void
: Inserts or updates a component in the specified pending state.addSymbol(symbolTuple: any)
: Adds a symbol tuple to the symbols array.replaceSymbols(offset: number, symbols: any[])
: Replaces the symbols array with a new array of symbol tuples.
Fields
removed: RemovedState
: The removed state.updated: UpdatedState
: The updated state.created: CreatedState
: The created state.symbols: (number | [InputPayload, number])[]
: The symbols array.isDiffed: boolean
: Indicates whether the pending state is diffed or not.