Move targeting to dedicated datatype within item

This commit is contained in:
2022-02-22 21:49:10 +00:00
parent 055fcf4cce
commit 8a7d06783d
9 changed files with 48 additions and 29 deletions
+3 -3
View File
@@ -10,9 +10,9 @@ useTargetPos
-> Creature
-> World
-> World
useTargetPos f cr w = case cr ^? crInv . ix (_crInvSel cr) . itTargeting . _Just of
useTargetPos f cr w = case cr ^? crInv . ix (_crInvSel cr) . itTargeting' . tgPos of
Nothing -> w
Just (g,_) -> f (g w) cr w
Just p -> f p cr w
removeItTarget :: Item -> Item
removeItTarget = itTargeting .~ Nothing
removeItTarget = itTargeting' . tgPos .~ Nothing