module: write module events using a struct pattern

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2024-04-03 08:13:22 -07:00 committed by Stephen Gutekanst
parent 582a3c07f6
commit 17db5498ee
13 changed files with 245 additions and 203 deletions

View file

@ -8,10 +8,13 @@ const assets = @import("assets");
pub const name = .game_text;
pub const Mod = mach.Mod(@This());
pub const events = .{
.{ .global = .deinit, .handler = deinit },
.{ .global = .init, .handler = init },
.{ .local = .prepare, .handler = prepare },
pub const global_events = .{
.deinit = .{ .handler = deinit },
.init = .{ .handler = init },
};
pub const local_events = .{
.prepare = .{ .handler = prepare },
};
const RegionMap = std.AutoArrayHashMapUnmanaged(u21, mach.gfx.Atlas.Region);