Work on inventory management
This commit is contained in:
+14
-2
@@ -48,8 +48,20 @@ you w = _creatures w IM.! _yourID w
|
||||
aCrPos :: Int -> World -> Point2
|
||||
aCrPos i w = _crPos $ _creatures w IM.! i
|
||||
|
||||
yourItem :: World -> Item
|
||||
yourItem w = _crInv (you w) IM.! _crInvSel (you w)
|
||||
yourItem :: World -> Maybe Item
|
||||
yourItem w = _crInv (you w) IM.!? _crInvSel (you w)
|
||||
|
||||
yourInv :: World -> IM.IntMap Item
|
||||
yourInv w = _crInv (you w)
|
||||
|
||||
yourInvSel :: World -> Int
|
||||
yourInvSel w = _crInvSel (you w)
|
||||
|
||||
selectedObject :: World -> Maybe (Either FloorItem Button)
|
||||
selectedObject w = lookup (_crInvSel ycr) $ zip [n..] $ _closeObjects w
|
||||
where
|
||||
ycr = you w
|
||||
n = length $ _crInv ycr
|
||||
|
||||
crItem :: World -> Int -> Item
|
||||
crItem w cid = _crInv cr IM.! _crInvSel cr
|
||||
|
||||
Reference in New Issue
Block a user