Skip to content

Commit

Permalink
Add components parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Ukendio committed Sep 6, 2024
1 parent c844012 commit 9af08c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
6 changes: 2 additions & 4 deletions demo/src/ReplicatedStorage/std/scheduler.luau
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local jabby = require(ReplicatedStorage.Packages.jabby)
local jecs = require(ReplicatedStorage.ecs)
local components = require(ReplicatedStorage.std.components)
local pair = jecs.pair
type World = jecs.World
type Entity<T=nil> = jecs.Entity<T>
Expand Down Expand Up @@ -47,7 +46,7 @@ export type Scheduler = {
phase: (after: Entity) -> Entity
}

local scheduler_new: (w: World) -> Scheduler
local scheduler_new: (w: World, components: { [string]: Entity }) -> Scheduler


do
Expand Down Expand Up @@ -166,7 +165,7 @@ do
return system
end

function scheduler_new(w)
function scheduler_new(w: World, components: { [string]: Entity })
world = w
Disabled = world:component()
System = world:component()
Expand Down Expand Up @@ -243,7 +242,6 @@ do
end
end


return {
new = scheduler_new
}
9 changes: 5 additions & 4 deletions demo/src/ReplicatedStorage/std/start.luau
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local jabby = require(ReplicatedStorage.Packages.jabby)
local Scheduler = require(ReplicatedStorage.std.scheduler)
local world = require(ReplicatedStorage.std.world)
local std = require(ReplicatedStorage.std)
local Scheduler = std.Scheduler
local world = std.world

local function start(modules)
local scheduler = Scheduler.new(world)
local scheduler = Scheduler.new(world, ReplicatedStorage.std.components)
for _, module in modules do
require(module)(scheduler)
end
Expand All @@ -26,7 +27,7 @@ local function start(modules)
end
dtor = client.spawn_app(client.apps.home)
end
end )
end)
end
end

Expand Down

0 comments on commit 9af08c0

Please sign in to comment.