aboutsummaryrefslogtreecommitdiff
path: root/ecs/component.go
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2025-07-04 17:55:53 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2025-07-04 23:02:21 +0200
commita5fef758107888853c14a592696b45768ef56df8 (patch)
tree9d1fd0b0abb49ce6814b8868926bf7af83611303 /ecs/component.go
parente3f14fc0b375b4b7c2204a669d058ac124b78e92 (diff)
Refactor into packages
Diffstat (limited to 'ecs/component.go')
-rw-r--r--ecs/component.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/ecs/component.go b/ecs/component.go
new file mode 100644
index 0000000..29ef967
--- /dev/null
+++ b/ecs/component.go
@@ -0,0 +1,10 @@
+package ecs
+
+type Component[T any] struct {
+ IsEnabled bool
+ Value T
+}
+
+func C[T any](t T) Component[T] {
+ return Component[T]{IsEnabled: true, Value: t}
+}