Skip to content

Commit

Permalink
update ecs
Browse files Browse the repository at this point in the history
  • Loading branch information
kayhhh committed Apr 17, 2024
1 parent 9912410 commit 33df2c7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
18 changes: 15 additions & 3 deletions spatial/wit/wired-ecs/world.wit
Original file line number Diff line number Diff line change
Expand Up @@ -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<tuple<entity, component-instance>>;
}

resource ecs-world {
register-component: func() -> component;
spawn: func() -> entity;
register-query: func(components: list<borrow<component>>) -> query;
spawn: func(components: list<component-instance>) -> entity;
}
}
18 changes: 15 additions & 3 deletions spatial/wit/wired-script/deps/wired-ecs/world.wit
Original file line number Diff line number Diff line change
Expand Up @@ -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<tuple<entity, component-instance>>;
}

resource ecs-world {
register-component: func() -> component;
spawn: func() -> entity;
register-query: func(components: list<borrow<component>>) -> query;
spawn: func(components: list<component-instance>) -> entity;
}
}

0 comments on commit 33df2c7

Please sign in to comment.