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

@ -16,8 +16,8 @@ direction: Vec2 = vec2(0, 0),
spawning: bool = false,
spawn_timer: mach.Timer,
pub const components = struct {
pub const follower = void;
pub const components = .{
.{ .name = .follower, .type = void },
};
pub const events = .{

View file

@ -20,10 +20,10 @@ uniform_buffer: *gpu.Buffer,
pub const name = .renderer;
pub const Mod = mach.Mod(@This());
pub const components = struct {
pub const location = Vec3;
pub const rotation = Vec3;
pub const scale = f32;
pub const components = .{
.{ .name = .location, .type = Vec3 },
.{ .name = .rotation, .type = Vec3 },
.{ .name = .scale, .type = f32 },
};
pub const events = .{