mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-24 17:10:03 +00:00
Merge conflicts
This commit is contained in:
commit
efe9f0cc34
4 changed files with 22 additions and 14 deletions
|
@ -8,17 +8,17 @@ A collection of third-party jecs addons made by the community. If you would like
|
||||||
|
|
||||||
A jecs debugger with a string-based query language and entity editing capabilities.
|
A jecs debugger with a string-based query language and entity editing capabilities.
|
||||||
|
|
||||||
## [jecs_entity_visualiser](https://github.com/Ukendio/jecs/tree/main/addons/entity_visualiser)
|
## [jecs_entity_visualiser](https://github.com/Ukendio/jecs/blob/main/addons/entity_visualiser.luau)
|
||||||
|
|
||||||
A simple entity and component visualiser in the output
|
A simple entity and component visualiser in the output
|
||||||
|
|
||||||
## [jecs_lifetime_tracker](https://github.com/Ukendio/jecs/tree/main/addons/lifetime_tracker)
|
## [jecs_lifetime_tracker](https://github.com/Ukendio/jecs/blob/main/addons/lifetime_tracker.luau)
|
||||||
|
|
||||||
A tool for inspecting entity lifetimes
|
A tool for inspecting entity lifetimes
|
||||||
|
|
||||||
# Helpers
|
# Helpers
|
||||||
|
|
||||||
## [jecs_observers](https://github.com/Ukendio/jecs/tree/main/addons/observers)
|
## [jecs_observers](https://github.com/Ukendio/jecs/blob/main/addons/observers.luau)
|
||||||
|
|
||||||
Observers for queries and signals for components
|
Observers for queries and signals for components
|
||||||
|
|
||||||
|
@ -41,4 +41,16 @@ Provides hooks and a scheduler that implements jabby and a topographical runtime
|
||||||
An agnostic scheduler inspired by Bevy and Flecs, with core features including phases, pipelines, run conditions, and startup systems.
|
An agnostic scheduler inspired by Bevy and Flecs, with core features including phases, pipelines, run conditions, and startup systems.
|
||||||
Planck also provides plugins for Jabby, Matter Hooks, and more.
|
Planck also provides plugins for Jabby, Matter Hooks, and more.
|
||||||
|
|
||||||
|
# Replication
|
||||||
|
|
||||||
|
## [feces](https://github.com/NeonD00m/feces)
|
||||||
|
|
||||||
|
A generalized replication system for jecs
|
||||||
|
|
||||||
|
# Input
|
||||||
|
|
||||||
|
## [Axis](https://github.com/NeonD00m/axis)
|
||||||
|
|
||||||
|
An agnostic, simple and versatile input library for ECS
|
||||||
|
|
||||||
# Observers
|
# Observers
|
||||||
|
|
|
@ -14,6 +14,10 @@ A (component) ID can be marked with `Tag´ in which the component will never con
|
||||||
|
|
||||||
Hooks are part of the "interface" of a component. You could consider hooks as the counterpart to OOP methods in ECS. They define the behavior of a component, but can only be invoked through mutations on the component data. You can only configure a single `OnAdd`, `OnRemove` and `OnSet` hook per component, just like you can only have a single constructor and destructor.
|
Hooks are part of the "interface" of a component. You could consider hooks as the counterpart to OOP methods in ECS. They define the behavior of a component, but can only be invoked through mutations on the component data. You can only configure a single `OnAdd`, `OnRemove` and `OnSet` hook per component, just like you can only have a single constructor and destructor.
|
||||||
|
|
||||||
|
::: warning
|
||||||
|
Hooks, added to a component that has already been added to other entities/components, will not be called.
|
||||||
|
:::
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
::: code-group
|
::: code-group
|
||||||
|
|
|
@ -633,15 +633,14 @@ TEST("world:each()", function()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
FOCUS()
|
|
||||||
TEST("world:entity()", function()
|
TEST("world:entity()", function()
|
||||||
do CASE "range"
|
do CASE "range"
|
||||||
local world = jecs.world()
|
local world = jecs.world()
|
||||||
world = lifetime_tracker_add(world, {})
|
world = lifetime_tracker_add(world, {})
|
||||||
world:range(1000, 2000)
|
world:range(1000, 2000)
|
||||||
|
|
||||||
world:entity(1590)
|
world:entity(1590)
|
||||||
CHECK_EXPECT_ERR(function()
|
CHECK_EXPECT_ERR(function()
|
||||||
|
|
||||||
world:entity(5000)
|
world:entity(5000)
|
||||||
end)
|
end)
|
||||||
|
@ -654,7 +653,6 @@ TEST("world:entity()", function()
|
||||||
end
|
end
|
||||||
do CASE "desired id"
|
do CASE "desired id"
|
||||||
local world = jecs.world()
|
local world = jecs.world()
|
||||||
world = lifetime_tracker_add(world, {})
|
|
||||||
local id = world:entity()
|
local id = world:entity()
|
||||||
local e = world:entity(id + 5)
|
local e = world:entity(id + 5)
|
||||||
CHECK(e == id + 5)
|
CHECK(e == id + 5)
|
||||||
|
@ -671,8 +669,7 @@ TEST("world:entity()", function()
|
||||||
CHECK(e3 == world:entity(e3))
|
CHECK(e3 == world:entity(e3))
|
||||||
|
|
||||||
world:delete(e3)
|
world:delete(e3)
|
||||||
|
|
||||||
print("---------------------------")
|
|
||||||
local e3v1 = world:entity(275)
|
local e3v1 = world:entity(275)
|
||||||
CHECK(not world:contains(275))
|
CHECK(not world:contains(275))
|
||||||
CHECK(jecs.ECS_GENERATION(e3v1) == 1)
|
CHECK(jecs.ECS_GENERATION(e3v1) == 1)
|
||||||
|
@ -681,11 +678,7 @@ TEST("world:entity()", function()
|
||||||
|
|
||||||
CHECK(world:contains(e3v1))
|
CHECK(world:contains(e3v1))
|
||||||
-- world:print_entity_index()
|
-- world:print_entity_index()
|
||||||
print("--------begin")
|
|
||||||
world:entity(e3)
|
world:entity(e3)
|
||||||
print("-----end")
|
|
||||||
|
|
||||||
world:print_entity_index()
|
|
||||||
|
|
||||||
world:entity(e3)
|
world:entity(e3)
|
||||||
world:entity(275)
|
world:entity(275)
|
||||||
|
|
|
@ -253,7 +253,6 @@ local function FOCUS()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function FINISH(): number
|
local function FINISH(): number
|
||||||
local success = true
|
|
||||||
local total_cases = 0
|
local total_cases = 0
|
||||||
local passed_cases = 0
|
local passed_cases = 0
|
||||||
local passed_focus_cases = 0
|
local passed_focus_cases = 0
|
||||||
|
|
Loading…
Reference in a new issue