Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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`
- Loading branch information