mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-25 17:40:02 +00:00
Compare commits
10 commits
870bd1375c
...
495f95d35e
Author | SHA1 | Date | |
---|---|---|---|
|
495f95d35e | ||
|
bce46bc93f | ||
|
acc6e40aed | ||
|
9878df20ba | ||
|
b365fc8c1c | ||
|
a8004011cc | ||
|
c697030ec4 | ||
|
fefbd19b38 | ||
|
d5dc64be1b | ||
|
04ef154193 |
4 changed files with 41 additions and 7 deletions
3
.github/workflows/analysis.yaml
vendored
3
.github/workflows/analysis.yaml
vendored
|
@ -16,4 +16,5 @@ jobs:
|
|||
|
||||
- name: Analyze
|
||||
run: |
|
||||
output=$(luau-analyze src || true) # Suppress errors for now.
|
||||
(luau-analyze src || true) > analyze-log.txt # Suppress errors for now.
|
||||
bash ./scripts/gh-warn-luau-analyze.sh analyze-log.txt
|
||||
|
|
|
@ -1995,6 +1995,7 @@ local function world_each(world: World, id): () -> ()
|
|||
archetype = archetypes[archetype_id]
|
||||
entities = archetype.entities
|
||||
row = #entities
|
||||
entity = entities[row]
|
||||
end
|
||||
row -= 1
|
||||
return entity
|
||||
|
|
13
scripts/gh-warn-luau-analyze.sh
Normal file
13
scripts/gh-warn-luau-analyze.sh
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Read the input file line by line
|
||||
while IFS= read -r line; do
|
||||
# Use regex to capture file name, line number, column number, and message
|
||||
if [[ $line =~ ^(.+)\(([0-9]+),([0-9]+)\):\ (.+)$ ]]; then
|
||||
file="${BASH_REMATCH[1]}"
|
||||
line_number="${BASH_REMATCH[2]}"
|
||||
column_number="${BASH_REMATCH[3]}"
|
||||
message="${BASH_REMATCH[4]}"
|
||||
|
||||
# Format output for GitHub Actions
|
||||
echo "::warning file=$file,line=$line_number,col=$column_number::${message}"
|
||||
fi
|
||||
done < "$1"
|
|
@ -900,20 +900,39 @@ end)
|
|||
|
||||
TEST("world:children", function()
|
||||
local world = world_new()
|
||||
local e1 = world:entity()
|
||||
local e2 = world:entity()
|
||||
local e3 = world:entity()
|
||||
local C = world:component()
|
||||
local T = world:entity()
|
||||
|
||||
local e1 = world:entity()
|
||||
world:set(e1, C, true)
|
||||
|
||||
local e2 = world:entity()
|
||||
|
||||
world:add(e2, T)
|
||||
world:add(e2, pair(ChildOf, e1))
|
||||
|
||||
local e3 = world:entity()
|
||||
world:add(e3, pair(ChildOf, e1))
|
||||
|
||||
for entity in world:children(pair(ChildOf, e1)) do
|
||||
local count = 0
|
||||
for entity in world:children(e1) do
|
||||
count += 1
|
||||
if entity == e2 or entity == e3 then
|
||||
CHECK(true)
|
||||
continue
|
||||
end
|
||||
CHECK(false)
|
||||
end
|
||||
CHECK(count == 2)
|
||||
|
||||
world:remove(e2, pair(ChildOf, e1))
|
||||
|
||||
count = 0
|
||||
for entity in world:children(e1) do
|
||||
count += 1
|
||||
end
|
||||
|
||||
CHECK(count == 1)
|
||||
end)
|
||||
|
||||
TEST("world:clear()", function()
|
||||
|
@ -1562,9 +1581,9 @@ TEST("repro", function()
|
|||
local world = world_new()
|
||||
local component1 = world:component()
|
||||
local tag1 = world:entity()
|
||||
|
||||
|
||||
local query = world:query(component1):with(tag1):cached()
|
||||
|
||||
|
||||
local entity = world:entity()
|
||||
world:set(entity, component1, "some data")
|
||||
|
||||
|
|
Loading…
Reference in a new issue