INNER CODE UNIT · Go
Add
yohamta0/donburi-ecs · entry.go:40
func Add[T any](e *Entry, c component.IComponentType, component *T) {
e.AddComponent(c, unsafe.Pointer(component))
}
// Set sets the comopnent of the entry.
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)
}