From 13626410c4d6db7fdc15ded5ee7865fcdbf0b88a Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Thu, 15 Jan 2026 22:05:38 +0100 Subject: 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. --- resource.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'resource.go') 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 } -- cgit v1.3