diff --git a/src/iter.zig b/src/iter.zig index 6ecff7b..02a88b4 100644 --- a/src/iter.zig +++ b/src/iter.zig @@ -33,11 +33,11 @@ pub fn Iter(comptime ctx: anytype) type { return (self.raw.flags & c.EcsIterIsValid) != 0; } - pub fn getCount(self: Self) usize { + pub fn count(self: Self) usize { return @intCast(self.raw.count); } - pub fn getDeltaTime(self: Self) f32 { + pub fn deltaTime(self: Self) f32 { return self.raw.delta_time; } @@ -45,8 +45,8 @@ pub fn Iter(comptime ctx: anytype) type { const raw_ptr = c.ecs_field_w_size(self.raw, @sizeOf(T), @intCast(index)); var typed_ptr: [*]T = @alignCast(@ptrCast(raw_ptr)); const is_self = c.ecs_field_is_self(self.raw, @intCast(index)); - const count = if (is_self) self.getCount() else 1; - return typed_ptr[0..count]; + const count_ = if (is_self) self.count() else 1; + return typed_ptr[0..count_]; } pub fn fieldId(self: Self, index: usize) Id { diff --git a/src/test/flecs/world.zig b/src/test/flecs/world.zig index 19e4534..02d33cb 100644 --- a/src/test/flecs/world.zig +++ b/src/test/flecs/world.zig @@ -24,8 +24,8 @@ fn move(it: Iter) void { util.Probe.probeIter(it) catch unreachable; for (pos, vel) |*p, *v| { - p.x += v.x * it.getDeltaTime(); - p.y += v.y * it.getDeltaTime(); + p.x += v.x * it.deltaTime(); + p.y += v.y * it.deltaTime(); } } diff --git a/src/test/util.zig b/src/test/util.zig index e0da3d9..ac22463 100644 --- a/src/test/util.zig +++ b/src/test/util.zig @@ -50,7 +50,7 @@ pub const Probe = struct { try expect(e != 0); } - for (0..it.getCount()) |i| { + for (0..it.count()) |i| { if (i + ctx.count < 256) { ctx.e[i + ctx.count] = it.raw.entities[i]; } else { @@ -59,7 +59,7 @@ pub const Probe = struct { unreachable; } } - ctx.count += it.getCount(); + ctx.count += it.count(); ctx.invoked += 1; }