INNER CODE UNIT · Go

SetValue

yohamta0/donburi-ecs · entry.go:50

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)
}

// Valid returns true if the entry is valid.
func Valid(e *Entry) bool {
	if e == nil {
		return false

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…