Add Read/Show instance for Creature
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user