mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-24 17:10:03 +00:00
decouple start
This commit is contained in:
parent
5deb7e5b35
commit
adeb562baa
7 changed files with 152 additions and 150 deletions
3
.luaurc
3
.luaurc
|
@ -3,5 +3,6 @@
|
|||
"jecs": "src",
|
||||
"testkit": "testkit",
|
||||
"mirror": "mirror",
|
||||
}
|
||||
},
|
||||
languageMode: "strict"
|
||||
}
|
||||
|
|
BIN
demo.rbxl
BIN
demo.rbxl
Binary file not shown.
|
@ -7,7 +7,7 @@ local Scheduler = std.Scheduler
|
|||
local world = std.world
|
||||
|
||||
local function start(modules)
|
||||
local scheduler = Scheduler.new(world, ReplicatedStorage.std.components)
|
||||
local scheduler = Scheduler.new(world, require(ReplicatedStorage.std.components))
|
||||
for _, module in modules do
|
||||
require(module)(scheduler)
|
||||
end
|
|
@ -19,7 +19,6 @@ local std = {
|
|||
world = world :: World,
|
||||
pair = jecs.pair,
|
||||
__ = jecs.w,
|
||||
start = require(script.start)
|
||||
}
|
||||
|
||||
return std
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
local start = require(ReplicatedStorage.std.start)
|
||||
local start = require(ReplicatedStorage.start)
|
||||
|
||||
start(script.Parent:WaitForChild("systems"):GetChildren())
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
local start = require(ReplicatedStorage.std.start)
|
||||
local start = require(ReplicatedStorage.start)
|
||||
|
||||
start(script.Parent:WaitForChild("systems"):GetChildren())
|
||||
|
|
|
@ -740,24 +740,25 @@ local function world_clear(world: World, entity: i53)
|
|||
entity_move(world.entityIndex, entity, record, ROOT_ARCHETYPE)
|
||||
end
|
||||
|
||||
local function archetype_fast_delete_last(columns: { Column },
|
||||
local world_delete: (world: World, entity: i53) -> ()
|
||||
do
|
||||
local function archetype_fast_delete_last(columns: { Column },
|
||||
column_count: number, types: { i53 }, entity: i53)
|
||||
|
||||
for i, column in columns do
|
||||
column[column_count] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function archetype_fast_delete(columns: { Column },
|
||||
local function archetype_fast_delete(columns: { Column },
|
||||
column_count: number, row, types, entity)
|
||||
|
||||
for i, column in columns do
|
||||
column[row] = column[column_count]
|
||||
column[column_count] = nil
|
||||
end
|
||||
end
|
||||
|
||||
local function archetype_delete(world: World,
|
||||
end
|
||||
local function archetype_delete(world: World,
|
||||
archetype: Archetype, row: number)
|
||||
|
||||
local entityIndex = world.entityIndex
|
||||
|
@ -885,9 +886,9 @@ local function archetype_delete(world: World,
|
|||
end
|
||||
component_index[o] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function world_delete(world: World, entity: i53)
|
||||
function world_delete(world: World, entity: i53)
|
||||
local entityIndex = world.entityIndex
|
||||
|
||||
local record = entityIndex.sparse[entity]
|
||||
|
@ -906,6 +907,7 @@ function world_delete(world: World, entity: i53)
|
|||
|
||||
record.archetype = nil :: any
|
||||
entityIndex.sparse[entity] = nil
|
||||
end
|
||||
end
|
||||
|
||||
local function world_contains(world: World, entity): boolean
|
||||
|
|
Loading…
Reference in a new issue