|
|
@ -15,7 +15,9 @@ pub fn Context(comptime ctx: anytype) type { |
|
|
|
/// type that has been registered previously, typically done by |
|
|
|
/// type that has been registered previously, typically done by |
|
|
|
/// calling functions such as `World.component(...)`. |
|
|
|
/// calling functions such as `World.component(...)`. |
|
|
|
pub fn lookup(comptime T: type) c.ecs_entity_t { |
|
|
|
pub fn lookup(comptime T: type) c.ecs_entity_t { |
|
|
|
return lookupMut(T).*; |
|
|
|
const result = lookupMut(T).*; |
|
|
|
|
|
|
|
if (result == 0) std.debug.panic("No lookup for {s}", .{@typeName(T)}); |
|
|
|
|
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// Returns a pointer unique to this `Context` and the provided type |
|
|
|
/// Returns a pointer unique to this `Context` and the provided type |
|
|
|