From 33df2c711c7cd1a857654235477ce6143ab2fb33 Mon Sep 17 00:00:00 2001 From: Kayh Date: Wed, 17 Apr 2024 16:28:38 -0400 Subject: [PATCH] update ecs --- spatial/wit/wired-ecs/world.wit | 18 +++++++++++++++--- .../wit/wired-script/deps/wired-ecs/world.wit | 18 +++++++++++++++--- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/spatial/wit/wired-ecs/world.wit b/spatial/wit/wired-ecs/world.wit index ca39866..312eb05 100644 --- a/spatial/wit/wired-ecs/world.wit +++ b/spatial/wit/wired-ecs/world.wit @@ -5,11 +5,23 @@ world host { } interface types { - resource component {} - resource entity {} + resource component-instance {} + + resource component { + new: func() -> component-instance; + } + + resource entity { + insert: func(component: component-instance); + } + + resource query { + read: func() -> list>; + } resource ecs-world { register-component: func() -> component; - spawn: func() -> entity; + register-query: func(components: list>) -> query; + spawn: func(components: list) -> entity; } } diff --git a/spatial/wit/wired-script/deps/wired-ecs/world.wit b/spatial/wit/wired-script/deps/wired-ecs/world.wit index ca39866..312eb05 100644 --- a/spatial/wit/wired-script/deps/wired-ecs/world.wit +++ b/spatial/wit/wired-script/deps/wired-ecs/world.wit @@ -5,11 +5,23 @@ world host { } interface types { - resource component {} - resource entity {} + resource component-instance {} + + resource component { + new: func() -> component-instance; + } + + resource entity { + insert: func(component: component-instance); + } + + resource query { + read: func() -> list>; + } resource ecs-world { register-component: func() -> component; - spawn: func() -> entity; + register-query: func(components: list>) -> query; + spawn: func(components: list) -> entity; } }