Add newtype to floor item ids

This commit is contained in:
2024-09-23 22:42:09 +01:00
parent 43b365185d
commit 265da89791
20 changed files with 193 additions and 158 deletions
+3 -2
View File
@@ -3,6 +3,7 @@ module Dodge.Item.Location.Initialize
, initItemLocations
)
where
import NewInt
import Dodge.Data.LWorld
import Control.Lens
import qualified IntMapHelp as IM
@@ -17,9 +18,9 @@ initCrsItemLocations w = w' & creatures .~ newcreatures
(w', newcreatures) = mapAccumR initCrItemLocations w (w ^. creatures)
initFlItemsLocations :: LWorld -> LWorld
initFlItemsLocations w = w' & floorItems .~ newfloorItems
initFlItemsLocations w = w' & floorItems .~ NIntMap newfloorItems
where
(w', newfloorItems) = mapAccumR initFlItemLocation w (w ^. floorItems)
(w', newfloorItems) = mapAccumR initFlItemLocation w (w ^. floorItems . unNIntMap)
initTusItemLocations :: LWorld -> LWorld
initTusItemLocations w = w' & machines .~ newmachines