module Dodge.Inventory.ItemSpace 
    ( itSlotsTaken
    ) where
import Dodge.Data
import Dodge.Module

import Control.Lens
--import Data.Maybe

itSlotsTaken :: Item -> Int
itSlotsTaken it = case it ^? itConsumption . icAmount of
    Nothing -> moduleSizes it + ceiling (_itInvSize it)
    Just i  -> moduleSizes it + ceiling (_itInvSize it * fromIntegral i)
