master
Mike 5 years ago
parent 896095fc15
commit f0c711123e

@ -139,6 +139,7 @@ pub const OwningGroup = struct {
}
fn validate(self: OwningGroup, comptime Components: var) void {
if (std.builtin.mode == .Debug and self.group_data.owned.len > 0) {
std.debug.assert(@typeInfo(Components) == .Struct);
inline for (@typeInfo(Components).Struct.fields) |field| {
@ -147,6 +148,7 @@ pub const OwningGroup = struct {
std.debug.assert(found != null);
}
}
}
pub fn getOwned(self: OwningGroup, entity: Entity, comptime Components: var) Components {
self.validate(Components);

Loading…
Cancel
Save