You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
336 B
Lua
32 lines
336 B
Lua
local ecs = require "ecs"
|
|
|
|
local w = ecs.world()
|
|
|
|
w:register {
|
|
name = "value",
|
|
type = "int",
|
|
}
|
|
|
|
w:register {
|
|
name = "mark"
|
|
}
|
|
|
|
w:new {
|
|
value = 1,
|
|
mark = true,
|
|
}
|
|
|
|
w:new {
|
|
mark = true,
|
|
}
|
|
|
|
|
|
for v in w:select "mark" do
|
|
w:sync("value?in", v)
|
|
print(v.value)
|
|
end
|
|
|
|
for v in w:select "mark" do
|
|
print(pcall(w.sync, w, "value:in", v))
|
|
end
|