mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-25 09:30:03 +00:00
fix: Fix type of world:has() to explicitly take in an entity
This commit is contained in:
parent
7b6c5ac85d
commit
04172c2e53
2 changed files with 2 additions and 1 deletions
|
@ -17,6 +17,7 @@ The format is based on [Keep a Changelog][kac], and this project adheres to
|
||||||
- Applies to `world:add()`, `world:set()`, `world:remove()`, `world:get()`, `world:has()` and `world:query()`
|
- Applies to `world:add()`, `world:set()`, `world:remove()`, `world:get()`, `world:has()` and `world:query()`
|
||||||
- New exported type `Id<T = nil> = Entity<T> | Pair`
|
- New exported type `Id<T = nil> = Entity<T> | Pair`
|
||||||
- Make `world:contains()` return a `boolean` instead of an entity which may or may not exist
|
- Make `world:contains()` return a `boolean` instead of an entity which may or may not exist
|
||||||
|
- Fix `world:has()` to explicitly take in an entity (new: `(self: World, entity: Entity, ...id) -> boolean`, old: `(self: World, ...Id) -> boolean`)
|
||||||
|
|
||||||
## [0.2.2] - 2024-07-07
|
## [0.2.2] - 2024-07-07
|
||||||
|
|
||||||
|
|
|
@ -1537,7 +1537,7 @@ export type World = {
|
||||||
& (<A, B, C>(self: World, id: Entity, Id<A>, Id<B>, Id<C>) -> (A?, B?, C?))
|
& (<A, B, C>(self: World, id: Entity, Id<A>, Id<B>, Id<C>) -> (A?, B?, C?))
|
||||||
& <A, B, C, D>(self: World, id: Entity, Id<A>, Id<B>, Id<C>, Id<D>) -> (A?, B?, C?, D?),
|
& <A, B, C, D>(self: World, id: Entity, Id<A>, Id<B>, Id<C>, Id<D>) -> (A?, B?, C?, D?),
|
||||||
|
|
||||||
has: (self: World, ...Id) -> boolean,
|
has: (self: World, entity: Entity, ...Id) -> boolean,
|
||||||
|
|
||||||
parent: (self: World, entity: Entity) -> Entity,
|
parent: (self: World, entity: Entity) -> Entity,
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue