From 8711e5e3a7b9a86dd488f343d5de8990a91bf381 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Wed, 27 Mar 2024 12:00:30 -0700 Subject: [PATCH] module: rename MComponentTypes -> ComponentTypesM (consistency with LocalArgsM, etc.) Signed-off-by: Stephen Gutekanst --- src/module.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/module.zig b/src/module.zig index 1bde6096..aa1ead45 100644 --- a/src/module.zig +++ b/src/module.zig @@ -15,7 +15,7 @@ fn ModuleInterface(comptime M: type) type { if (!@hasDecl(M, "events")) @compileError(prefix ++ "must have `pub const events = .{};`"); // TODO: re-enable this validation once module event handler arguments would not pose a type dependency loop // validateEvents("mach: module ." ++ @tagName(M.name) ++ " ", M.events); - _ = MComponentTypes(M); + _ = ComponentTypesM(M); return M; } @@ -372,7 +372,7 @@ pub fn Module( comptime NSComponents: type, ) type { const module_tag = M.name; - const components = MComponentTypes(M){}; + const components = ComponentTypesM(M){}; return struct { state: M, entities: *Entities(NSComponents{}), @@ -698,7 +698,7 @@ fn validateEvents(comptime error_prefix: anytype, comptime events: anytype) void pub fn ComponentTypesByName(comptime modules: anytype) type { var fields: []const std.builtin.Type.StructField = &[0]std.builtin.Type.StructField{}; inline for (modules) |M| { - const MC = MComponentTypes(M); + const MC = ComponentTypesM(M); fields = fields ++ [_]std.builtin.Type.StructField{.{ .name = @tagName(M.name), .type = MC, @@ -710,7 +710,7 @@ pub fn ComponentTypesByName(comptime modules: anytype) type { // Builtin components // TODO: better method of injecting builtin module? - const BuiltinMC = MComponentTypes(struct { + const BuiltinMC = ComponentTypesM(struct { pub const name = .builtin; pub const components = .{ .{ .name = .id, .type = EntityID, .description = "Entity ID" }, @@ -743,7 +743,7 @@ pub fn ComponentTypesByName(comptime modules: anytype) type { /// rotation: @TypeOf() = .{ .type = Vec2, .description = "rotation component" }, /// } /// ``` -fn MComponentTypes(comptime M: anytype) type { +fn ComponentTypesM(comptime M: anytype) type { const error_prefix = "mach: module ." ++ @tagName(M.name) ++ " .components "; if (!@hasDecl(M, "components")) { return struct {};