module: rename all_components -> component_types_by_name

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2024-05-04 12:45:29 -07:00
parent 7ccfcefa96
commit b37ece1b9a
4 changed files with 34 additions and 34 deletions

View file

@ -271,22 +271,22 @@ pub inline fn debugAssertRowType(storage: *Archetype, row: anytype) void {
}
// TODO: comptime refactor
pub fn Slicer(comptime all_components: anytype) type {
pub fn Slicer(comptime component_types_by_name: anytype) type {
return struct {
archetype: *Archetype,
pub fn slice(
slicer: @This(),
// TODO: cleanup comptime
comptime namespace_name: std.meta.FieldEnum(@TypeOf(all_components)),
comptime component_name: std.meta.FieldEnum(@TypeOf(@field(all_components, @tagName(namespace_name)))),
comptime namespace_name: std.meta.FieldEnum(@TypeOf(component_types_by_name)),
comptime component_name: std.meta.FieldEnum(@TypeOf(@field(component_types_by_name, @tagName(namespace_name)))),
) []@field(
@field(all_components, @tagName(namespace_name)),
@field(component_types_by_name, @tagName(namespace_name)),
@tagName(component_name),
).type {
// TODO: cleanup comptime
const Type = @field(
@field(all_components, @tagName(namespace_name)),
@field(component_types_by_name, @tagName(namespace_name)),
@tagName(component_name),
).type;
if (namespace_name == .entity and component_name == .id) {