Add Read/Show instance for Creature

This commit is contained in:
2022-07-22 10:44:54 +01:00
parent 4c5218c633
commit 6b69fc1684
35 changed files with 345 additions and 225 deletions
+3 -2
View File
@@ -27,7 +27,7 @@ module Dodge.Creature.Test
import Dodge.Data
import Dodge.Base.Collide
import Geometry
import SameConstr
--import SameConstr
import Data.List (find)
import Data.Maybe
@@ -64,7 +64,8 @@ crSafeDistFromTarg d cr = case cr ^? crIntention . targetCr . _Just of
Nothing -> True
crStratConMatches :: Strategy -> Creature -> Bool
crStratConMatches strat cr = eqConstr strat (_apStrategy $ _crActionPlan cr)
crStratConMatches strat cr = strat == (_apStrategy $ _crActionPlan cr)
-- this equality check might be slow...
crAwayFromPost :: Creature -> Bool
crAwayFromPost cr = case find sentinelGoal . _apGoal $ _crActionPlan cr of