module Dodge.Item.Weapon.Targeting
    where
import Dodge.Data
import Geometry.Data

import Control.Lens
--import qualified Data.IntMap.Strict as IM
useTargetPos 
    :: (Maybe Point2 -> Creature -> World -> World)
    -> Creature
    -> World
    -> World
useTargetPos f cr w = case cr ^? crInv . ix (_crInvSel cr) . itTargeting . _Just of
    Nothing -> w
    Just (g,_) -> f (g w) cr w

removeItTarget :: Item -> Item
removeItTarget = itTargeting .~ Nothing
