From d99d612e68a2654fd3540fbc6b411e0d900058cc Mon Sep 17 00:00:00 2001 From: justin Date: Wed, 3 May 2023 20:03:05 +0100 Subject: [PATCH] Reorganise --- src/Dodge/Item/SlotsTaken.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/Dodge/Item/SlotsTaken.hs diff --git a/src/Dodge/Item/SlotsTaken.hs b/src/Dodge/Item/SlotsTaken.hs new file mode 100644 index 000000000..d4d9afa0c --- /dev/null +++ b/src/Dodge/Item/SlotsTaken.hs @@ -0,0 +1,12 @@ +module Dodge.Item.SlotsTaken ( + itSlotsTaken, +) where + +import Control.Lens +import Dodge.Data.Item +import Dodge.Module + +itSlotsTaken :: Item -> Int +itSlotsTaken it = case it ^? itUse . useAmount of + Nothing -> moduleSizes it + ceiling (_itInvSize it) + Just i -> moduleSizes it + ceiling (_itInvSize it * fromIntegral i)