17 lines
333 B
Haskell
17 lines
333 B
Haskell
module Dodge.Item.Weapon.Targeting (
|
|
useTargetPos,
|
|
) where
|
|
|
|
import Control.Lens
|
|
import Dodge.Data.World
|
|
import Geometry.Data
|
|
|
|
useTargetPos ::
|
|
(Maybe Point2 -> Creature -> World -> World) ->
|
|
Creature ->
|
|
World ->
|
|
World
|
|
useTargetPos f cr w = case cr ^? crTargeting . ctPos of
|
|
Nothing -> w
|
|
Just p -> f p cr w
|