From e631a83f79a6c90fca1cede049c61c6935847af6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=9Eeta=20Narut?= <36481442+setanarut@users.noreply.github.com> Date: Tue, 14 May 2024 04:22:06 +0300 Subject: [PATCH] Add component.GetValue() (#135) --- component.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/component.go b/component.go index d0b69c0..317c9a1 100644 --- a/component.go +++ b/component.go @@ -44,6 +44,11 @@ func (c *ComponentType[T]) Get(entry *Entry) *T { return (*T)(entry.Component(c)) } +// GetValue returns value of the component from the entry. +func (c *ComponentType[T]) GetValue(entry *Entry) T { + return *Get[T](entry, c) +} + // Set sets component data to the entry. func (c *ComponentType[T]) Set(entry *Entry, component *T) { entry.SetComponent(c, unsafe.Pointer(component))