Skip to content

Commit 3094abd

Browse files
authored
Offload subrecords of GameState to other modules (#1667)
This is a continuation of #1652. Most of the sub-records are bundled into `Swarm.Game.State.Substate`, but we create a `Swarm.Game.State.Robot` module just for robots. We introduce a `zoomRobots` function so that applicable functions can operate directly on `Robots` state instead of `GameState`. ## Size comparison ### Before | File | Lines | | --- | --- | | `State.hs` | 1569 | ### After | File | Lines | | --- | --- | | `State.hs` | 812 | | `Substate.hs` | 497 | | `Robot.hs` | 395 | | `Config.hs` | 21 | ## For follow-up PR: - [ ] Remove exports of `_viewCenter` and `_focusedRobotID` from `Swarm.Game.State.Robot`
1 parent b244a42 commit 3094abd

File tree

29 files changed

+1121
-911
lines changed

29 files changed

+1121
-911
lines changed

src/Swarm/Game/Scenario/Topography/Structure/Recognition/Tracking.hs

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import Swarm.Game.Scenario.Topography.Structure.Recognition.Log
3232
import Swarm.Game.Scenario.Topography.Structure.Recognition.Registry
3333
import Swarm.Game.Scenario.Topography.Structure.Recognition.Type
3434
import Swarm.Game.State
35+
import Swarm.Game.State.Substate
3536
import Swarm.Game.Universe
3637
import Swarm.Game.World.Modify
3738
import Text.AhoCorasick

0 commit comments

Comments
 (0)