module: components are written in the same style as events

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2024-03-26 13:19:58 -07:00 committed by Stephen Gutekanst
parent f50a27b83d
commit 7e0b9dde68
10 changed files with 265 additions and 123 deletions

View file

@ -47,8 +47,8 @@ test "example" {
pointer: u8,
pub const name = .physics;
pub const components = struct {
pub const id = u32;
pub const components = .{
.{ .name = .id, .type = u32 },
};
pub const events = .{
.{ .global = .tick, .handler = tick },
@ -61,8 +61,8 @@ test "example" {
const Renderer = struct {
pub const name = .renderer;
pub const components = struct {
pub const id = u16;
pub const components = .{
.{ .name = .ud, .type = u16 },
};
pub const events = .{
.{ .global = .tick, .handler = tick },