ecsia-monorepo / react/src / EcsiaWorld
Interface: EcsiaWorld
Defined in: react/src/world.ts:35
The structural world slice @ecsia/react consumes and useWorld() returns.
Properties
tick
ts
readonly tick: number;Defined in: react/src/world.ts:36
query
ts
query: WorldQuery;Defined in: react/src/world.ts:46
Methods
currentTick()
ts
currentTick(): number;Defined in: react/src/world.ts:37
Returns
number
spawn()
ts
spawn(): EntityHandle;Defined in: react/src/world.ts:38
Returns
EntityHandle
spawnWith()
ts
spawnWith<T>(...specs): EntityHandle;Defined in: react/src/world.ts:39
Type Parameters
| Type Parameter |
|---|
T extends readonly SpawnArg[] |
Parameters
| Parameter | Type |
|---|---|
...specs | { [I in string | number | symbol]: SpawnArgFor<T[I]> } |
Returns
EntityHandle
add()
ts
add(handle, def): void;Defined in: react/src/world.ts:40
Parameters
| Parameter | Type |
|---|---|
handle | EntityHandle |
def | ComponentDef<Readonly<Record<string, FieldToken>>> |
Returns
void
remove()
ts
remove(handle, def): void;Defined in: react/src/world.ts:41
Parameters
| Parameter | Type |
|---|---|
handle | EntityHandle |
def | ComponentDef<Readonly<Record<string, FieldToken>>> |
Returns
void
despawn()
ts
despawn(handle): void;Defined in: react/src/world.ts:42
Parameters
| Parameter | Type |
|---|---|
handle | EntityHandle |
Returns
void
isAlive()
ts
isAlive(handle): boolean;Defined in: react/src/world.ts:43
Parameters
| Parameter | Type |
|---|---|
handle | EntityHandle |
Returns
boolean
has()
ts
has(handle, def): boolean;Defined in: react/src/world.ts:44
Parameters
| Parameter | Type |
|---|---|
handle | EntityHandle |
def | ComponentDef<Readonly<Record<string, FieldToken>>> |
Returns
boolean
entity()
ts
entity(handle, opts?): EntityRefLike;Defined in: react/src/world.ts:45
Parameters
| Parameter | Type |
|---|---|
handle | EntityHandle |
opts? | { lenient?: boolean; } |
opts.lenient? | boolean |
Returns
observe()
ts
observe(term, handler): ObserverHandle;Defined in: react/src/world.ts:47
Parameters
| Parameter | Type |
|---|---|
term | ObserverTerm |
handler | (e, ctx) => void |
Returns
decodeHandle()
ts
decodeHandle(handle): {
index: EntityIndex;
};Defined in: react/src/world.ts:48
Parameters
| Parameter | Type |
|---|---|
handle | EntityHandle |
Returns
ts
{
index: EntityIndex;
}index
ts
index: EntityIndex;