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. --- monad/monad.go | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 monad/monad.go (limited to 'monad') diff --git a/monad/monad.go b/monad/monad.go new file mode 100644 index 0000000..43fb241 --- /dev/null +++ b/monad/monad.go @@ -0,0 +1,10 @@ +package monad + +type Option[T any] struct { + Ok bool + Value T +} + +func Some[T any](value T) Option[T] { + return Option[T]{Ok: true, Value: value} +} -- cgit v1.3