aboutsummaryrefslogtreecommitdiff
path: root/resource.go
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-01-15 22:05:38 +0100
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-01-15 22:05:46 +0100
commit13626410c4d6db7fdc15ded5ee7865fcdbf0b88a (patch)
treea549d918804acb7682c857e742f1af189692cf62 /resource.go
parentcf85fc095bc9b6ab4b49e4f88a5f04d7ac2fe74b (diff)
refactor: transition to struct-of-arrays ECS architecture
- Replace individual Entity structs with centralized component slices in Game struct (SoA layout). - Implement bitmask-based component lookup (CM_Position, CM_Move, etc.). - Convert logic from object-oriented Update() methods to standalone Systems (UpdateMoveSystem, UpdateGatherSystem, UpdateSpawnSystem). - Update rendering, selection, and input handling to iterate over component arrays.
Diffstat (limited to 'resource.go')
-rw-r--r--resource.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/resource.go b/resource.go
index d52a438..5fb48ae 100644
--- a/resource.go
+++ b/resource.go
@@ -2,6 +2,8 @@ package main
import (
"time"
+
+ "age_of_empires/ecs"
)
type ResourceSource struct {
@@ -11,7 +13,7 @@ type ResourceSource struct {
type ResourceGatherer struct {
MaxCapacity int
CurrentVolume int
- CurrentTarget *Entity
+ Source ecs.Entity
LastPickupTime time.Time
}