|
|
|
@ -279,7 +279,14 @@ pub fn Entity(comptime ctx: anytype) type { |
|
|
|
|
|
|
|
|
|
pub fn get(self: Self, comptime T: type) ?*const T { |
|
|
|
|
const id = Lookup(ctx, T).id; |
|
|
|
|
return @alignCast(@ptrCast(c.ecs_get_id(self.world.raw, self.raw, id))); |
|
|
|
|
const ptr = c.ecs_get_id(self.world.raw, self.raw, id); |
|
|
|
|
return @alignCast(@ptrCast(ptr)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
pub fn get_mut(self: Self, comptime T: type) ?*T { |
|
|
|
|
const id = Lookup(ctx, T).id; |
|
|
|
|
const ptr = c.ecs_get_mut_id(self.world.raw, self.raw, id); |
|
|
|
|
return @alignCast(@ptrCast(ptr)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
pub fn set(self: Self, comptime T: type, value: T) void { |
|
|
|
|