Merge branch 'dev'

This commit is contained in:
BlackMATov
2025-01-31 12:51:30 +07:00
7 changed files with 3389 additions and 1938 deletions

View File

@@ -101,6 +101,10 @@ fragment :: fragment_builder
fragment_builder:tag :: fragment_builder
fragment_builder:default :: component -> fragment_builder
fragment_builder:construct :: {any... -> component} -> fragment_builder
fragment_builder:on_set :: {entity, fragment, component, component?} -> fragment_builder
fragment_builder:on_assign :: {entity, fragment, component, component} -> fragment_builder
fragment_builder:on_insert :: {entity, fragment, component} -> fragment_builder
fragment_builder:on_remove :: {entity, fragment} -> fragment_builder
fragment_builder:build :: fragment, boolean
```

View File

@@ -2,12 +2,12 @@
## Backlog
- add auto chunk count reducing
- optimize batch operations for cases with moving entities to empty chunks
- should we clear chunk's components by on_insert tag callback?
- clear chunk's tables instead reallocating them
- add REQUIRES fragment trait
- try to keep entity_chunks/places tables as arrays
- set/assign/insert/remove/destroy for lists?
- when we call hooks from chunk operations, we should use precached hook functions
- we shouldn't clear big reusable tables
## After first release
- auto chunk count reducing
- add REQUIRES fragment trait
- use compact prefix-tree for chunks
- set/assign/insert/remove/clear/destroy for lists

View File

@@ -1,8 +1,8 @@
package.loaded['evolved'] = nil
local evo = require 'evolved'
require 'develop.unload' 'evolved'
local basics = require 'develop.basics'
local evo = require 'evolved'
local N = 1000
local B = evo.entity()
local F1, F2, F3, F4, F5 = evo.id(5)

8
develop/unload.lua Normal file
View File

@@ -0,0 +1,8 @@
---@param pattern string
return function(pattern)
for name, _ in pairs(package.loaded) do
if name:match(pattern) then
package.loaded[name] = nil
end
end
end

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
package.loaded['evolved'] = nil
local evo = require 'evolved'
require 'develop.unload' 'evolved'
local basics = require 'develop.basics'
local evo = require 'evolved'
local tiny = require 'develop.3rdparty.tiny'
local N = 1000

File diff suppressed because it is too large Load Diff