mirror of
https://github.com/BlackMATov/evolved.lua.git
synced 2025-12-14 12:10:23 +07:00
update roadmap
This commit is contained in:
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"[json][jsonc][lua]": {
|
"[json][jsonc][lua][markdown]": {
|
||||||
"editor.formatOnSave": true,
|
"editor.formatOnSave": true,
|
||||||
"files.insertFinalNewline": true,
|
"files.insertFinalNewline": true,
|
||||||
"files.trimFinalNewlines": true,
|
"files.trimFinalNewlines": true,
|
||||||
|
|||||||
@@ -2,4 +2,5 @@
|
|||||||
|
|
||||||
## Backlog
|
## Backlog
|
||||||
|
|
||||||
- add tag-fragment trait
|
- add tag-fragment trait
|
||||||
|
- allow structural changes in ON_REMOVE hooks
|
||||||
|
|||||||
32
evolved.lua
32
evolved.lua
@@ -13,8 +13,8 @@ local evolved = {}
|
|||||||
---@field __entities evolved.entity[]
|
---@field __entities evolved.entity[]
|
||||||
---@field __fragments table<evolved.fragment, boolean>
|
---@field __fragments table<evolved.fragment, boolean>
|
||||||
---@field __components table<evolved.fragment, evolved.component[]>
|
---@field __components table<evolved.fragment, evolved.component[]>
|
||||||
---@field __with_fragment_cache table<evolved.fragment, evolved.chunk>
|
---@field __with_fragment_edges table<evolved.fragment, evolved.chunk>
|
||||||
---@field __without_fragment_cache table<evolved.fragment, evolved.chunk>
|
---@field __without_fragment_edges table<evolved.fragment, evolved.chunk>
|
||||||
|
|
||||||
---
|
---
|
||||||
---
|
---
|
||||||
@@ -191,8 +191,8 @@ local function __root_chunk(fragment)
|
|||||||
__entities = {},
|
__entities = {},
|
||||||
__fragments = { [fragment] = true },
|
__fragments = { [fragment] = true },
|
||||||
__components = { [fragment] = {} },
|
__components = { [fragment] = {} },
|
||||||
__with_fragment_cache = {},
|
__with_fragment_edges = {},
|
||||||
__without_fragment_cache = {},
|
__without_fragment_edges = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
do
|
do
|
||||||
@@ -223,8 +223,8 @@ local function __chunk_with_fragment(chunk, fragment)
|
|||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
local cached_chunk = chunk.__with_fragment_cache[fragment]
|
local with_fragment_chunk = chunk.__with_fragment_edges[fragment]
|
||||||
if cached_chunk then return cached_chunk end
|
if with_fragment_chunk then return with_fragment_chunk end
|
||||||
end
|
end
|
||||||
|
|
||||||
if fragment == chunk.__fragment then
|
if fragment == chunk.__fragment then
|
||||||
@@ -236,8 +236,8 @@ local function __chunk_with_fragment(chunk, fragment)
|
|||||||
__chunk_with_fragment(chunk.__parent, fragment),
|
__chunk_with_fragment(chunk.__parent, fragment),
|
||||||
chunk.__fragment)
|
chunk.__fragment)
|
||||||
|
|
||||||
chunk.__with_fragment_cache[fragment] = sibling_chunk
|
chunk.__with_fragment_edges[fragment] = sibling_chunk
|
||||||
sibling_chunk.__without_fragment_cache[fragment] = chunk
|
sibling_chunk.__without_fragment_edges[fragment] = chunk
|
||||||
|
|
||||||
return sibling_chunk
|
return sibling_chunk
|
||||||
end
|
end
|
||||||
@@ -250,8 +250,8 @@ local function __chunk_with_fragment(chunk, fragment)
|
|||||||
__entities = {},
|
__entities = {},
|
||||||
__fragments = { [fragment] = true },
|
__fragments = { [fragment] = true },
|
||||||
__components = { [fragment] = {} },
|
__components = { [fragment] = {} },
|
||||||
__with_fragment_cache = {},
|
__with_fragment_edges = {},
|
||||||
__without_fragment_cache = {},
|
__without_fragment_edges = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
for f, _ in pairs(chunk.__components) do
|
for f, _ in pairs(chunk.__components) do
|
||||||
@@ -265,8 +265,8 @@ local function __chunk_with_fragment(chunk, fragment)
|
|||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
chunk.__with_fragment_cache[fragment] = child_chunk
|
chunk.__with_fragment_edges[fragment] = child_chunk
|
||||||
child_chunk.__without_fragment_cache[fragment] = chunk
|
child_chunk.__without_fragment_edges[fragment] = chunk
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
@@ -293,8 +293,8 @@ local function __chunk_without_fragment(chunk, fragment)
|
|||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
local cached_chunk = chunk.__without_fragment_cache[fragment]
|
local without_fragment_edge = chunk.__without_fragment_edges[fragment]
|
||||||
if cached_chunk then return cached_chunk end
|
if without_fragment_edge then return without_fragment_edge end
|
||||||
end
|
end
|
||||||
|
|
||||||
if fragment == chunk.__fragment then
|
if fragment == chunk.__fragment then
|
||||||
@@ -306,8 +306,8 @@ local function __chunk_without_fragment(chunk, fragment)
|
|||||||
__chunk_without_fragment(chunk.__parent, fragment),
|
__chunk_without_fragment(chunk.__parent, fragment),
|
||||||
chunk.__fragment)
|
chunk.__fragment)
|
||||||
|
|
||||||
chunk.__without_fragment_cache[fragment] = sibling_chunk
|
chunk.__without_fragment_edges[fragment] = sibling_chunk
|
||||||
sibling_chunk.__with_fragment_cache[fragment] = chunk
|
sibling_chunk.__with_fragment_edges[fragment] = chunk
|
||||||
|
|
||||||
return sibling_chunk
|
return sibling_chunk
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user