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