module: begin improved query implementation

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2024-05-06 10:53:13 -07:00
parent 2075959dad
commit 261f94d3bc
4 changed files with 194 additions and 61 deletions

View file

@ -1,6 +1,8 @@
const std = @import("std");
const testing = std.testing;
const ComponentTypesByName = @import("module.zig").ComponentTypesByName;
const merge = @import("main.zig").merge;
const builtin_modules = @import("main.zig").builtin_modules;
pub const QueryTag = enum {
any,
@ -80,7 +82,8 @@ test "query" {
const Rotation = struct { degrees: f32 };
const modules = .{
const modules = merge(.{
builtin_modules,
struct {
pub const name = .game;
pub const components = .{
@ -97,7 +100,7 @@ test "query" {
struct {
pub const name = .renderer;
},
};
});
const Q = Query(modules);