debug mode on/off function

This commit is contained in:
BlackMATov
2025-03-10 08:10:49 +07:00
parent 0476c2e949
commit f39c151408
4 changed files with 21 additions and 3 deletions

View File

@@ -104,6 +104,10 @@ execute :: query -> {execute_state? -> chunk?, entity[]?, integer?}, execute_sta
process :: phase... -> ()
```
```
debug :: boolean -> ()
```
```
spawn_at :: chunk?, fragment[]?, component[]? -> entity, boolean
spawn_with :: fragment[]?, component[]? -> entity, boolean

View File

@@ -2,8 +2,7 @@
## Backlog
- add manual gc for unreachable chunks
- add destroing policies (fragments, phases, systems)
- collect unreachable chunks
## After first release

View File

@@ -2,6 +2,8 @@ require 'develop.unload' 'evolved'
local evo = require 'evolved'
evo.debug(true)
do
local e1, e2 = evo.id(), evo.id()
assert(e1 ~= e2)

View File

@@ -92,7 +92,7 @@ local evolved = {
---
---
local __debug_mode = true ---@type boolean
local __debug_mode = false ---@type boolean
local __freelist_ids = {} ---@type integer[]
local __acquired_count = 0 ---@type integer
@@ -6685,6 +6685,17 @@ end
---
---
---@param debug boolean
local function __evolved_debug(debug)
__debug_mode = debug
end
---
---
---
---
---
---@class (exact) evolved.__entity_builder
---@field package __fragment_list? evolved.fragment[]
---@field package __component_list? evolved.component[]
@@ -7785,6 +7796,8 @@ evolved.process = __evolved_process
evolved.spawn_at = __evolved_spawn_at
evolved.spawn_with = __evolved_spawn_with
evolved.debug = __evolved_debug
evolved.entity = __evolved_entity
evolved.fragment = __evolved_fragment
evolved.query = __evolved_query