module: write components using a struct pattern
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
17db5498ee
commit
2115f5832a
8 changed files with 45 additions and 62 deletions
|
|
@ -754,9 +754,9 @@ test "example" {
|
|||
struct {
|
||||
pub const name = .game;
|
||||
pub const components = .{
|
||||
.{ .name = .name, .type = []const u8 },
|
||||
.{ .name = .location, .type = Location },
|
||||
.{ .name = .rotation, .type = Rotation },
|
||||
.name = .{ .type = []const u8 },
|
||||
.location = .{ .type = Location },
|
||||
.rotation = .{ .type = Rotation },
|
||||
};
|
||||
},
|
||||
}){};
|
||||
|
|
@ -858,9 +858,9 @@ test "many entities" {
|
|||
struct {
|
||||
pub const name = .game;
|
||||
pub const components = .{
|
||||
.{ .name = .name, .type = []const u8 },
|
||||
.{ .name = .location, .type = Location },
|
||||
.{ .name = .rotation, .type = Rotation },
|
||||
.name = .{ .type = []const u8 },
|
||||
.location = .{ .type = Location },
|
||||
.rotation = .{ .type = Rotation },
|
||||
};
|
||||
},
|
||||
}){};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue