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
+11 -5
View File
@@ -21,6 +21,7 @@ module Dodge.Creature.Perception.Data
)
where
import Control.Lens
import Dodge.Data.FloatFunction
import qualified IntMapHelp as IM
data Perception = Perception
@@ -30,14 +31,18 @@ data Perception = Perception
, _cpVision :: Vision
, _cpAudition :: Audition
}
deriving (Eq,Ord,Show,Read)
data Vision = Eyes
{ _viFOV :: Float -> Float
, _viDist :: Float -> Float
{ _viFOV :: FloatFloat
, _viDist :: FloatFloat
}
deriving (Eq,Ord,Show,Read)
newtype Audition = Ears
{ _auDist :: Float -> Float
{ _auDist :: FloatFloat
}
deriving (Eq,Ord,Show,Read)
data Vigilance
= Comatose
@@ -45,16 +50,17 @@ data Vigilance
| Lethargic
| Vigilant
| Overstrung
deriving (Eq,Ord,Show)
deriving (Eq,Ord,Show,Read)
data Attention
= AttentiveTo {_getAttentiveTo :: IM.IntMap Awareness }
| Fixated {_getFixated :: Int }
deriving (Eq,Ord,Show,Read)
data Awareness
= Suspicious Float
| Cognizant Float
deriving (Eq,Ord)
deriving (Eq,Ord,Show,Read)
makeLenses ''Attention
makeLenses ''Perception