Skip to content

Commit

Permalink
simplify wired-scene api to use constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
kayhhh committed Jul 5, 2024
1 parent 597f002 commit 4aa27eb
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions spatial/wit/wired-scene/world.wit
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface material {
}

resource material {
id: func() -> u32;
constructor();

name: func() -> string;
set-name: func(value: string);
Expand All @@ -25,16 +25,12 @@ interface material {
}

list-materials: func() -> list<material>;
create-material: func() -> material;
remove-material: func(value: material);
}

interface mesh {
use material.{material};

resource primitive {
id: func() -> u32;

material: func() -> option<material>;
set-material: func(value: option<borrow<material>>);

Expand All @@ -45,7 +41,7 @@ interface mesh {
}

resource mesh {
id: func() -> u32;
constructor();

name: func() -> string;
set-name: func(value: string);
Expand All @@ -56,8 +52,6 @@ interface mesh {
}

list-meshes: func() -> list<mesh>;
create-mesh: func() -> mesh;
remove-mesh: func(value: mesh);
}

interface node {
Expand All @@ -67,7 +61,7 @@ interface node {
use wired:physics/types.{collider, rigid-body};

resource node {
id: func() -> u32;
constructor();

name: func() -> string;
set-name: func(value: string);
Expand Down Expand Up @@ -95,6 +89,4 @@ interface node {
}

list-nodes: func() -> list<node>;
create-node: func() -> node;
remove-node: func(value: node);
}

0 comments on commit 4aa27eb

Please sign in to comment.