Commit graph

118 commits

Author SHA1 Message Date
Marcus
303bd4ed16
Entity recycling (#156)
* Merge

* Initial commit

* Fix indentations

* Remove sparse_count

* Add whiteline

* return 0 instead

* Add check for friend existing

* Force inlining

* Manual inlining
2024-11-13 20:05:01 +01:00
Ukendio
4aca3ab192 Ignore stylua 2024-11-10 04:14:08 +01:00
Ukendio
ec91a5d1e9 Improve types for SolverV2 2024-11-10 02:24:58 +01:00
Ukendio
4fc36261c2 Praise StyLua Gods 2024-10-25 00:58:43 +02:00
Ukendio
e4b266d3d5 Provide fast path to hooks 2024-10-23 20:58:32 +02:00
Christopher Buss
0eb288e057
style: fix inconsistent project formatting (#144)
Closes #138
2024-10-12 22:18:11 +02:00
Ukendio
f82318c642 Merge to main branch 2024-10-12 22:06:31 +02:00
Ukendio
76ab6838f2 query:archetypes is a method 2024-10-12 22:00:51 +02:00
Marcus
c5e20aaf50
Reuse archetype_delete on world:clear (#141)
* Reuse archetype_delete on world:clear

* Add tests
2024-10-12 21:55:24 +02:00
Magic
11f9615495
fix: query:archetypes() didnt take self in type (#143) 2024-10-12 17:04:49 +02:00
Ukendio
2e246e1e7a Add cleanup to types 2024-10-09 00:54:22 +02:00
Marcus
c80bb0e2fd
Add tests for archetypes (#139)
* Add stylua

* Align HI_COMPONENT_ID
2024-10-06 03:36:36 +02:00
Ukendio
39e7c235bb Remove redundant checks 2024-10-05 02:02:33 +02:00
Marcus
c288a5fab5
Remove drain and next (#136) 2024-10-04 23:55:22 +02:00
Ukendio
9d3b12e1fe Cast refs to GraphEdge 2024-10-02 22:49:05 +02:00
Ukendio
ca3cc06400 Traverse refs for deletion 2024-10-01 17:30:51 +02:00
Axen
a090dd7a73
Remove world:target debug error (#137)
* Removed error about needing `index` in `world:target`

* The `index` parameter was made optional in #131

* Re-added `world.target` wrapper

* Remove world.target and world.remove wrappers

---------

Co-authored-by: EncodedVenom <32179912+EncodedVenom@users.noreply.github.com>
2024-09-30 00:05:19 +02:00
vnnh
d6932ff80e
Fix typo with archetype_traverse_remove (#135) 2024-09-29 03:34:32 +02:00
Ukendio
6def84e8d9 Precompute hashed type 2024-09-27 11:47:01 +02:00
Ukendio
73147f3fef Update Matter's time 2024-09-26 15:40:50 +02:00
Ukendio
91f151ee3f check for most occuring case 2024-09-24 01:11:24 +02:00
EncodedVenom
16e8055983
Allow nil indexing in world:target (#131)
* Allow nil index in world:target

* Fix the fun type at the bottom

* Update tests
2024-09-23 14:29:53 +02:00
Ukendio
68729446d0 Preallocate capacity 2024-09-22 19:57:13 +02:00
Ukendio
fbbb1de1df Save sparse_array as variable 2024-09-22 16:37:06 +02:00
Ukendio
95b166eca3 Reallocate tables 2024-09-22 16:19:31 +02:00
Ukendio
31880b71ac Improve world_delete performance 2024-09-22 03:36:44 +02:00
Ukendio
8320d1ce49 cleanup archetypes after deleting parent 2024-09-22 00:53:31 +02:00
Ukendio
b3d9ffd0bd Fix indentations 2024-09-22 00:52:58 +02:00
Ukendio
74ca305600 Improve debug message 2024-09-21 21:28:06 +02:00
Ukendio
5d6c2e8d42 Fix unit tests and debug mode to enforce OnRemove rules 2024-09-21 20:53:12 +02:00
Ukendio
1de93f9185 invoke OnRemove hooks before moving 2024-09-21 18:51:50 +02:00
Marcus
b3da0745bc
Fix cycles (#129) 2024-09-20 21:58:18 +02:00
Marcus
2ed869ba93
Archetype deletion (#126)
* initial commit

* cleanup edges

* rename ptr to edge
2024-09-20 21:29:50 +02:00
Marcus
bd187e69ad
Call entity_move before invoke_hook (#124) 2024-09-17 16:39:28 +02:00
Marcus
62ac6e62c0
Iter should not drain by default (#123) 2024-09-16 21:33:12 +02:00
Ukendio
699beccc1c Change display to explicit pair 2024-09-12 16:24:59 +02:00
Marcus
f8b2c8c2b3
Name the builtin components (#117)
* Add nth parameter to world:target

* Put archetype record creation into function

* Fix docs and comments

* Make EcsWildcard a component

* Name the builtin components
2024-09-11 02:53:15 +02:00
Marcus
244d799cec
Add nth parameter to world:target (#116)
* Add nth parameter to world:target

* Put archetype record creation into function

* Fix docs and comments
2024-09-10 23:56:42 +02:00
Ukendio
1503d7e462 Add a hooks cache 2024-09-09 03:22:20 +02:00
Ukendio
adeb562baa decouple start 2024-09-08 19:45:49 +02:00
Ukendio
1067a17101 Fix docs titles 2024-09-07 22:12:07 +02:00
Ukendio
aa3e0258e3 Make world:set idempotent for tags 2024-08-31 05:31:58 +02:00
Ukendio
d6179637af Collapse ORs 2024-08-31 05:02:09 +02:00
Marcus
f91ab4049f
Docs addons (#112)
* Fix indentations

* Add addons page

* Fix indent
2024-08-31 04:13:47 +02:00
Marcus
c37bc3c440
Add EcsOnDelete support (#111)
* Add EcsOnDelete support

* Shrink mask

* Add indentation for flags

* Rename page

* Add page to items

* IDs should be plural

* Polish changelog

* Cleanup action Remove is default
2024-08-30 19:19:20 +02:00
Magic
5b163a29c1
Expose world:contains() and query:drain() in types (#110)
* chore: Expose world:contains and query:drain in types

* chore: Actually expose query:drain(), ?

* chore: Document these and previous changes in CHANGELOG.md

* fix: Fix type of world:has() to explicitly take in an entity
2024-08-29 23:36:34 +02:00
Magic
bfb3db272a
Allow functions to accept any ID including pairs in type parameters (#109) 2024-08-28 19:42:01 +02:00
Marcus
3dd0bd30cd
Add EcsTag (#108)
* Add EcsTag

* Add tests
2024-08-28 19:26:57 +02:00
Magic
ff98e8b5fb
fix: OnAdd, OnRemove and OnSet were typed as Entity<any> rendering them unusable with strict types (#107) 2024-08-28 10:12:04 +02:00
Ketasaja
a54928ee03
Avoid unused variable warnings (#91) 2024-08-24 01:50:22 +02:00