mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-25 09:30:03 +00:00
modified: src/init.luau
This commit is contained in:
parent
0b32bc9f9b
commit
6d232c59c7
1 changed files with 4 additions and 4 deletions
|
@ -515,7 +515,7 @@ local function world_add(world: World, entity: i53, id: i53)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
notify_hook(world, EcsOnAdd, id, entity)
|
invoke_hook(world, EcsOnAdd, id, entity)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Symmetric like `World.add` but idempotent
|
-- Symmetric like `World.add` but idempotent
|
||||||
|
@ -529,7 +529,7 @@ local function world_set(world: World, entity: i53, id: i53, data: unknown)
|
||||||
-- and just set the data directly.
|
-- and just set the data directly.
|
||||||
local tr = to.records[id]
|
local tr = to.records[id]
|
||||||
from.columns[tr.column][record.row] = data
|
from.columns[tr.column][record.row] = data
|
||||||
notify_hook(world, EcsOnSet, id, entity, data)
|
invoke_hook(world, EcsOnSet, id, entity, data)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -546,7 +546,7 @@ local function world_set(world: World, entity: i53, id: i53, data: unknown)
|
||||||
local tr = to.records[id]
|
local tr = to.records[id]
|
||||||
to.columns[tr.column][record.row] = data
|
to.columns[tr.column][record.row] = data
|
||||||
|
|
||||||
notify_hook(world, EcsOnAdd, id, entity, data)
|
invoke_hook(world, EcsOnAdd, id, entity, data)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function world_component(world: World): i53
|
local function world_component(world: World): i53
|
||||||
|
@ -582,7 +582,7 @@ local function archetype_traverse_remove(world: World, id: i53, from: Archetype)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function world_remove(world: World, entity: i53, id: i53)
|
local function world_remove(world: World, entity: i53, id: i53)
|
||||||
notify_hook(world, EcsOnRemove, id, entity)
|
invoke_hook(world, EcsOnRemove, id, entity)
|
||||||
|
|
||||||
local entity_index = world.entityIndex
|
local entity_index = world.entityIndex
|
||||||
local record = entity_index.sparse[entity]
|
local record = entity_index.sparse[entity]
|
||||||
|
|
Loading…
Reference in a new issue