Cleanup Data

This commit is contained in:
2021-03-26 23:49:07 +01:00
parent fb1d7571e7
commit 62b5ffbfaa
7 changed files with 460 additions and 455 deletions
+5 -5
View File
@@ -6,9 +6,9 @@ import Geometry
import Control.Lens
-- isArmouredFrom :: Point2 -> Creature -> Bool
-- isArmouredFrom p cr
-- = p /= _crPos cr
-- && any (\it -> it ^? itIdentity == Just FrontArmour) (_crInv cr)
-- && angleVV (unitVectorAtAngle $ _crDir cr) (p -.- _crPos cr) < pi/2
isArmouredFrom :: Point2 -> Creature -> Bool
isArmouredFrom p cr
= p /= _crPos cr
&& any (\it -> it ^? itIdentity == Just FrontArmour) (_crInv cr)
&& angleVV (unitVectorAtAngle $ _crDir cr) (p -.- _crPos cr) < pi/2
-- even though angleVV can generate NaN, the comparison seems to deal with it