Refactor, try to limit dependencies

This commit is contained in:
2022-07-28 00:59:56 +01:00
parent 8aa5c17ab9
commit 160560af5f
418 changed files with 15104 additions and 13342 deletions
+15 -14
View File
@@ -1,19 +1,20 @@
module Dodge.WorldEvent.Damage
( damThingHitWith
) where
import Dodge.Data
import Geometry
module Dodge.WorldEvent.Damage (
damThingHitWith,
) where
import Dodge.Data.World
import Dodge.Wall.Damage
import Geometry
import LensHelp
damThingHitWith
:: (Point2 -> Point2 -> Point2 -> Damage)
-> Point2
-> Point2
-> Maybe (Point2, Either Creature Wall)
-> World
-> World
damThingHitWith ::
(Point2 -> Point2 -> Point2 -> Damage) ->
Point2 ->
Point2 ->
Maybe (Point2, Either Creature Wall) ->
World ->
World
damThingHitWith partDT sp ep mayEiCrWl = case mayEiCrWl of
Just (hitp,Left cr) -> cWorld . creatures . ix (_crID cr) . crState . csDamage .:~ partDT sp hitp ep
Just (hitp,Right wl) -> damageWall (partDT sp hitp ep) wl
Just (hitp, Left cr) -> cWorld . creatures . ix (_crID cr) . crState . csDamage .:~ partDT sp hitp ep
Just (hitp, Right wl) -> damageWall (partDT sp hitp ep) wl
Nothing -> id