From 531ae84819c0568293ce865df9c632ed92f9de73 Mon Sep 17 00:00:00 2001 From: menduz Date: Sun, 13 Aug 2023 00:27:09 -0300 Subject: [PATCH] fix tests --- zig-ecs/build.zig | 4 ++-- zig-ecs/examples/view_vs_group.zig | 2 +- zig-ecs/src/ecs/registry.zig | 2 +- zig-ecs/src/ecs/views.zig | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/zig-ecs/build.zig b/zig-ecs/build.zig index 4fe1245..fc09c06 100644 --- a/zig-ecs/build.zig +++ b/zig-ecs/build.zig @@ -30,12 +30,12 @@ pub fn build(b: *Builder) void { .optimize = optimize, }); // exe.setOutputDir(std.fs.path.join(b.allocator, &[_][]const u8{ b.cache_root, "bin" }) catch unreachable); - exe.output_dirname_source = .{ .path = std.fs.path.join(b.allocator, &[_][]const u8{ b.cache_root.path.?, "bin" }) catch unreachable, .step = &exe.step }; + // exe.output_dirname_source = .{ .path = std.fs.path.join(b.allocator, &[_][]const u8{ b.cache_root.path.?, "bin" }) catch unreachable, .step = &exe.step }; exe.addModule("ecs", ecs_module); exe.linkLibC(); const docs = exe; - docs.emit_docs = .emit; + // docs.emit_docs = .emit; const doc = b.step(b.fmt("{s}-docs", .{name}), "Generate documentation"); doc.dependOn(&docs.step); diff --git a/zig-ecs/examples/view_vs_group.zig b/zig-ecs/examples/view_vs_group.zig index cd2e0be..5a47187 100644 --- a/zig-ecs/examples/view_vs_group.zig +++ b/zig-ecs/examples/view_vs_group.zig @@ -38,7 +38,7 @@ fn iterateView(reg: *ecs.Registry) void { var view = reg.view(.{ Velocity, Position }, .{}); var timer = std.time.Timer.start() catch unreachable; - var iter = view.iterator(); + var iter = view.entityIterator(); while (iter.next()) |entity| { var pos = view.get(Position, entity); const vel = view.getConst(Velocity, entity); diff --git a/zig-ecs/src/ecs/registry.zig b/zig-ecs/src/ecs/registry.zig index d87388c..9191bf8 100644 --- a/zig-ecs/src/ecs/registry.zig +++ b/zig-ecs/src/ecs/registry.zig @@ -571,7 +571,7 @@ pub const Registry = struct { // pre-fill the GroupData with any existing entitites that match if (owned.len == 0) { var view_instance = self.view(owned ++ includes, excludes); - var view_iter = view_instance.iterator(); + var view_iter = view_instance.entityIterator(); while (view_iter.next()) |entity| { new_group_data.entity_set.add(entity); } diff --git a/zig-ecs/src/ecs/views.zig b/zig-ecs/src/ecs/views.zig index c59c4da..89c1f7b 100644 --- a/zig-ecs/src/ecs/views.zig +++ b/zig-ecs/src/ecs/views.zig @@ -238,7 +238,7 @@ test "basic multi view" { var view = reg.view(.{ i32, u32 }, .{}); var iterated_entities: usize = 0; - var iter = view.iterator(); + var iter = view.entityIterator(); while (iter.next()) |_| { iterated_entities += 1; } @@ -276,7 +276,7 @@ test "basic multi view with excludes" { var view = reg.view(.{ i32, u32 }, .{u8}); var iterated_entities: usize = 0; - var iter = view.iterator(); + var iter = view.entityIterator(); while (iter.next()) |_| { iterated_entities += 1; }