Skip to content

Commit

Permalink
chore: Fix the spawner type for sapphire-jecs, release @ 0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Marks committed Aug 30, 2024
1 parent 3500ce8 commit c1c79c2
Show file tree
Hide file tree
Showing 12 changed files with 473 additions and 39 deletions.
2 changes: 2 additions & 0 deletions crates/sapphire-jecs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# sapphire-jecs
A lightweight scheduler + niceties (replication, etc.) for [Ukendio/jecs](https://github.com/Ukendio/jecs) for [Mark-Marks/sapphire](https://github.com/Mark-Marks/sapphire)

[And here's a small usage example](/dev/jecs/)

> [!CAUTION]
> Replicators set the `OnAdd`, `OnSet` and `OnRemove` hooks for tracked components.\
> This means that any defined of said hooks are overwritten. It is possible to make them coexist, though. For example:
Expand Down
5 changes: 2 additions & 3 deletions crates/sapphire-jecs/lib/init.luau
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ local world = require(script.world)
local handle = require(script.handle)
export type handle = handle.handle
local ref = require(script.ref)
local spawner_type = require(script.spawner_type)

local SapphireJecs = {}
--- @readonly
Expand Down Expand Up @@ -191,9 +192,7 @@ end
--- ```
--- @param ... T... -- Components to use.
--- @return spawner<T...>
function SapphireJecs.create_spawner<T...>(...: T...): spawner<T...>
return create_spawner(...)
end
SapphireJecs.create_spawner = (create_spawner :: any) :: spawner_type.create_spawner

--- A replicator keeps track of all entities with the passed components and their values -
--- whenever a component is changed (add, change, remove) and the replicator listens to it, it's also changed within the contained raw data.\
Expand Down
Loading

0 comments on commit c1c79c2

Please sign in to comment.