query start

This commit is contained in:
harper
2026-10-02 15:07:20 -07:00
parent e75f92ea4b
commit f7c830dcb8
2 changed files with 13 additions and 16 deletions
+11 -8
View File
@@ -1,18 +1,21 @@
package shoal
Entity :: struct {
id: int,
components: [dynamic]struct{},
Entity :: distinct u32
Storage :: struct($T: typeid) {
data: map[Entity]T,
}
spawn_entity :: proc(app: ^App) -> Entity {
spawn_entity :: proc(app: ^App, $T: typeid) -> Entity {
entity: Entity
entity_len := len(&app.entities)
entity.id = entity_len
return entity
}
add_collection :: proc(app: ^App, component: $T) {
add_collection :: proc(app: ^App, $T: typeid) {
storage: ^Storage(T)
app.storages[T] = storage
}
query :: proc(app: ^App, $T: typeid) {
}