mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-25 09:30:03 +00:00
Compare commits
1 commit
dd9e690518
...
b7cc9d5461
Author | SHA1 | Date | |
---|---|---|---|
|
b7cc9d5461 |
6 changed files with 4023 additions and 32 deletions
12
jecs.d.ts
vendored
12
jecs.d.ts
vendored
|
@ -40,18 +40,22 @@ type FlattenTuple<T extends unknown[]> = T extends [infer U] ? U : LuaTuple<T>;
|
|||
type Nullable<T extends unknown[]> = { [K in keyof T]: T[K] | undefined };
|
||||
type InferComponents<A extends Id[]> = { [K in keyof A]: InferComponent<A[K]> };
|
||||
|
||||
type ArchetypeId = number;
|
||||
type ArchetypeId = number
|
||||
type Column = unknown[];
|
||||
|
||||
type ArchetypeRecord = {
|
||||
count: number;
|
||||
column: number;
|
||||
}
|
||||
|
||||
export type Archetype = {
|
||||
id: number;
|
||||
types: number[];
|
||||
type: string;
|
||||
entities: number[];
|
||||
columns: Column[];
|
||||
records: number[];
|
||||
counts: number[];
|
||||
};
|
||||
records: ArchetypeRecord[];
|
||||
}
|
||||
|
||||
type Iter<T extends unknown[]> = IterableFunction<LuaTuple<[Entity, ...T]>>;
|
||||
|
||||
|
|
|
@ -950,7 +950,6 @@ local function archetype_delete(world: World, archetype: Archetype, row: number,
|
|||
record_to_move.row = row
|
||||
end
|
||||
|
||||
delete = entities[row]
|
||||
entities[row] = move
|
||||
end
|
||||
|
||||
|
|
4004
package-lock.json
generated
Normal file
4004
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@rbxts/jecs",
|
||||
"version": "0.5.5",
|
||||
"version": "0.5.4",
|
||||
"description": "Stupidly fast Entity Component System",
|
||||
"main": "jecs.luau",
|
||||
"repository": {
|
||||
|
|
|
@ -1045,22 +1045,6 @@ TEST("world:component()", function()
|
|||
end)
|
||||
|
||||
TEST("world:delete", function()
|
||||
do CASE "invoke OnRemove hooks"
|
||||
local world = world_new()
|
||||
|
||||
local e1 = world:entity()
|
||||
local e2 = world:entity()
|
||||
|
||||
local Stable = world:component()
|
||||
world:set(Stable, jecs.OnRemove, function(e)
|
||||
CHECK(e == e1)
|
||||
end)
|
||||
|
||||
world:set(e1, Stable, true)
|
||||
world:set(e2, Stable, true)
|
||||
|
||||
world:delete(e1)
|
||||
end
|
||||
do CASE "delete recycled entity id used as component"
|
||||
local world = world_new()
|
||||
local id = world:entity()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "ukendio/jecs"
|
||||
version = "0.5.5"
|
||||
version = "0.5.4"
|
||||
registry = "https://github.com/UpliftGames/wally-index"
|
||||
realm = "shared"
|
||||
license = "MIT"
|
||||
|
|
Loading…
Reference in a new issue