Cleanup
This commit is contained in:
@@ -4,9 +4,10 @@ module Dodge.Inventory.CheckSlots (
|
||||
crInvSize,
|
||||
) where
|
||||
|
||||
import Control.Lens
|
||||
import Data.Monoid
|
||||
import Dodge.Base.You
|
||||
import Dodge.Data.World
|
||||
import Dodge.Item.SlotsTaken
|
||||
import qualified IntMapHelp as IM
|
||||
|
||||
{- | checks whether or not an item will fit in your inventory
|
||||
@@ -14,7 +15,7 @@ import qualified IntMapHelp as IM
|
||||
-}
|
||||
checkInvSlotsYou :: Item -> World -> Maybe Int
|
||||
checkInvSlotsYou it w
|
||||
| crNumFreeSlots ycr >= ceiling (_itInvSize it) =
|
||||
| crNumFreeSlots ycr >= _itInvSize it =
|
||||
Just $ findItemSlot (_crInv ycr)
|
||||
| otherwise = Nothing
|
||||
where
|
||||
@@ -38,4 +39,5 @@ crInvSize :: Creature -> Int
|
||||
crInvSize = invSize . _crInv
|
||||
|
||||
invSize :: IM.IntMap Item -> Int
|
||||
invSize = sum . fmap itSlotsTaken
|
||||
invSize = alaf Sum foldMap _itInvSize
|
||||
--invSize = sum . fmap _itInvSize
|
||||
|
||||
Reference in New Issue
Block a user