Update Registry.removeAll to 0.8.0 HashMap API

master
LeRoyce Pearson 4 years ago
parent 6df575ee04
commit 514a893918

@ -343,10 +343,10 @@ pub const Registry = struct {
pub fn removeAll(self: *Registry, entity: Entity) void { pub fn removeAll(self: *Registry, entity: Entity) void {
assert(self.valid(entity)); assert(self.valid(entity));
var iter = self.components.iterator(); var iter = self.components.valueIterator();
while (iter.next()) |ptr| { while (iter.next()) |value| {
// HACK: we dont know the Type here but we need to be able to call methods on the Storage(T) // HACK: we dont know the Type here but we need to be able to call methods on the Storage(T)
var store = @intToPtr(*Storage(u1), ptr.value); var store = @intToPtr(*Storage(u1), value.*);
store.removeIfContains(entity); store.removeIfContains(entity);
} }
} }

Loading…
Cancel
Save