aboutsummaryrefslogtreecommitdiff
path: root/ecs
diff options
context:
space:
mode:
Diffstat (limited to 'ecs')
-rw-r--r--ecs/component.go22
-rw-r--r--ecs/entity.go3
2 files changed, 18 insertions, 7 deletions
diff --git a/ecs/component.go b/ecs/component.go
index 29ef967..ff22e53 100644
--- a/ecs/component.go
+++ b/ecs/component.go
@@ -1,10 +1,18 @@
package ecs
-type Component[T any] struct {
- IsEnabled bool
- Value T
-}
+type Mask uint16
-func C[T any](t T) Component[T] {
- return Component[T]{IsEnabled: true, Value: t}
-}
+const (
+ CM_Position Mask = 1 << iota
+ CM_RelBounds
+ CM_Image
+ CM_Selection
+ CM_Move
+ CM_Order
+ CM_PatrolOrder
+ CM_GatherOrder
+ CM_ResourceGatherer
+ CM_ResourceSource
+ CM_ResourceStorage
+ CM_Spawn
+)
diff --git a/ecs/entity.go b/ecs/entity.go
new file mode 100644
index 0000000..636470c
--- /dev/null
+++ b/ecs/entity.go
@@ -0,0 +1,3 @@
+package ecs
+
+type Entity int