INNER CODE UNIT · Go
Set
yohamta0/donburi-ecs · entry.go:45
func Set[T any](e *Entry, c component.IComponentType, component *T) {
e.SetComponent(c, unsafe.Pointer(component))
}
// SetValue sets the value of the component.
func SetValue[T any](e *Entry, c component.IComponentType, value T) {
*Get[T](e, c) = value
}
// GetValue gets the value of the component.
func GetValue[T any](e *Entry, c component.IComponentType) T {
return *Get[T](e, c)
}
// Remove removes the component from the entry.
func Remove[T any](e *Entry, ctype component.IComponentType) {
e.RemoveComponent(ctype)
}