query start
This commit is contained in:
+11
-8
@@ -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) {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user