This commit is contained in:
2024-11-29 01:37:45 +00:00
parent 61c0ba9251
commit 8d6b44e9f4
5 changed files with 94 additions and 110 deletions
-11
View File
@@ -1,7 +1,6 @@
module Dodge.Item.Location (
pointerToItemID,
pointerToItemLocation,
getItem,
pointerToItem,
pointerYourSelectedItem,
pointerYourRootItem,
@@ -12,16 +11,6 @@ import Control.Lens
import Data.Maybe
import Dodge.Data.World
getItem :: Int -> World -> Maybe Item
getItem itid w = do
itpos <- w ^? cWorld . lWorld . itemLocations . ix itid
case itpos of
OnFloor flitid -> w ^? cWorld . lWorld . floorItems . unNIntMap . ix (_unNInt flitid) . flIt
InInv {_ilCrID = cid, _ilInvID = invid}
-> w ^? cWorld . lWorld . creatures . ix cid . crInv . ix invid
OnTurret mcid -> w ^? cWorld . lWorld . machines . ix mcid . mcType . _McTurret . tuWeapon
InVoid -> Nothing
pointerToItemLocation ::
Applicative f =>
ItemLocation ->