Skip to content

EntityChange beta ​

TypeAlias of @v12-engine/engine

ts
export type EntityChange = [
    id: number,
    set: Partial<EntityState>,
    unset?: (keyof EntityState)[] | 0,
    ownSet?: Partial<OwnEntityState> | 0,
    ownUnset?: (keyof OwnEntityState)[] | 0,
    ownPatch?: Partial<Record<keyof OwnEntityState, WirePatch>>
];

An entity that changed, as a list rather than an object (what goes over the wire for each one adds up): its id, the fields that are new, those that are gone, and of what only its owner is told (own), the same, and its fields that changed in part, as what changed in them (WirePatch: one ability's cooldown). Trailing parts that say nothing are left off, the others 0