module: expose Module.LocalEvent type
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
38e0d576cc
commit
ca05c9f3d9
2 changed files with 9 additions and 9 deletions
|
|
@ -68,13 +68,13 @@ pub fn World(comptime mods: anytype) type {
|
|||
try world.entities.removeComponent(entity, module_tag, component_name);
|
||||
}
|
||||
|
||||
pub inline fn send(m: *@This(), comptime event_name: anytype, args: anytype) void {
|
||||
pub inline fn send(m: *@This(), comptime event_name: Modules.LocalEvent, args: anytype) void {
|
||||
const mod_ptr: *Mods = @alignCast(@fieldParentPtr(Mods, @tagName(module_tag), m));
|
||||
const world = @fieldParentPtr(WorldT, "mod", mod_ptr);
|
||||
world.modules.sendToModule(module_tag, event_name, args);
|
||||
}
|
||||
|
||||
pub inline fn sendGlobal(m: *@This(), event_name: Modules.GlobalEvent, args: anytype) void {
|
||||
pub inline fn sendGlobal(m: *@This(), comptime event_name: Modules.GlobalEvent, args: anytype) void {
|
||||
const mod_ptr: *Mods = @alignCast(@fieldParentPtr(Mods, @tagName(module_tag), m));
|
||||
const world = @fieldParentPtr(WorldT, "mod", mod_ptr);
|
||||
world.modules.send(event_name, args);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue