Refactor triplet to Selection datatype

This commit is contained in:
2025-08-26 18:13:27 +01:00
parent 9034c409e1
commit b87c3380b8
16 changed files with 127 additions and 135 deletions
+4 -6
View File
@@ -6,7 +6,6 @@
module Dodge.Data.HUD where
import Control.Lens
import Data.IntSet (IntSet)
import qualified Data.IntSet as IS
import Dodge.Data.Combine
import Dodge.Data.Item.Location
@@ -24,7 +23,7 @@ data SubInventory
}
| CombineInventory
{ _ciSections :: IMSS CombinableItem
, _ciSelection :: Maybe (Int, Int, IS.IntSet)
, _ciSelection :: Maybe Selection
, _ciFilter :: Maybe String
}
| DisplayTerminal {_termID :: Int}
@@ -32,7 +31,7 @@ data SubInventory
data HUD = HUD
{ _subInventory :: SubInventory
, _diSections :: IMSS ()
, _diSelection :: Maybe (Int, Int, IntSet)
, _diSelection :: Maybe Selection
, _diInvFilter :: Maybe String
, _diCloseFilter :: Maybe String
, _carteCenter :: Point2
@@ -42,9 +41,8 @@ data HUD = HUD
, _closeButtons :: [Int]
}
data Selection
= Sel {_slSec :: Int, _slInt :: Int, _slSet :: IS.IntSet}
| NoSel
data Selection = Sel {_slSec :: Int, _slInt :: Int, _slSet :: IS.IntSet}
makeLenses ''HUD
makeLenses ''Selection
makeLenses ''SubInventory