Add newtype for item id int
This commit is contained in:
@@ -40,7 +40,7 @@ initCrItemLocations w cr = (w', cr & crInv .~ newinv)
|
||||
-- does not worry about creature manipulation for now
|
||||
initCrItemLocation :: Creature -> Int -> LWorld -> Item -> (LWorld,Item)
|
||||
initCrItemLocation cr invid w it = (w & itemLocations . at locid ?~ loc
|
||||
,it & itID .~ locid
|
||||
,it & itID .~ NInt locid
|
||||
& itLocation .~ loc)
|
||||
where
|
||||
locid = IM.newKey ( w ^. itemLocations)
|
||||
@@ -55,7 +55,7 @@ initCrItemLocation cr invid w it = (w & itemLocations . at locid ?~ loc
|
||||
|
||||
initFlItemLocation :: LWorld -> FloorItem -> (LWorld, FloorItem)
|
||||
initFlItemLocation w flit = (w & itemLocations . at locid ?~ loc
|
||||
, flit & flIt . itID .~ locid
|
||||
, flit & flIt . itID .~ NInt locid
|
||||
& flIt . itLocation .~ loc
|
||||
)
|
||||
where
|
||||
@@ -69,6 +69,6 @@ initTuItemLocation w mc = case mc ^? mcType . _McTurret . tuWeapon of
|
||||
let locid = IM.newKey ( w ^. itemLocations)
|
||||
loc = OnTurret (_mcID mc)
|
||||
in ( w & itemLocations . at locid ?~ loc
|
||||
, mc & mcType . _McTurret . tuWeapon . itID .~ locid
|
||||
, mc & mcType . _McTurret . tuWeapon . itID .~ NInt locid
|
||||
& mcType . _McTurret . tuWeapon . itLocation .~ loc
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user