Rename Perception datatype/fields

This commit is contained in:
2022-06-18 10:08:06 +01:00
parent 66fda3fb93
commit a1c7abedaf
13 changed files with 76 additions and 85 deletions
+21 -21
View File
@@ -1,20 +1,20 @@
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE StrictData #-}
module Dodge.Creature.Perception.Data
( PerceptionState (..)
, AwakeLevel (..)
, AttentionDir (..)
, AwarenessLevel (..)
( Perception (..)
, Vigilance (..)
, Attention (..)
, Awareness (..)
, Vision (..)
, Audition (..)
-- lenses
, getAttentiveTo
, getFixated
, crAttentionDir
, crAwakeLevel
, crAwarenessLevel
, crVision
, crAudition
, cpAttention
, cpVigilance
, cpAwareness
, cpVision
, cpAudition
, viFOV
, viDist
, auDist
@@ -23,12 +23,12 @@ module Dodge.Creature.Perception.Data
import Control.Lens
import qualified Data.IntMap as IM
data PerceptionState = PerceptionState
{ _crAwakeLevel :: AwakeLevel
, _crAttentionDir :: AttentionDir
, _crAwarenessLevel :: IM.IntMap AwarenessLevel
, _crVision :: Vision
, _crAudition :: Audition
data Perception = Perception
{ _cpVigilance :: Vigilance
, _cpAttention :: Attention
, _cpAwareness :: IM.IntMap Awareness
, _cpVision :: Vision
, _cpAudition :: Audition
}
data Vision = Eyes
@@ -39,7 +39,7 @@ newtype Audition = Ears
{ _auDist :: Float -> Float
}
data AwakeLevel
data Vigilance
= Comatose
| Asleep
| Lethargic
@@ -47,16 +47,16 @@ data AwakeLevel
| Overstrung
deriving (Eq,Ord,Show)
data AttentionDir
= AttentiveTo {_getAttentiveTo :: IM.IntMap AwarenessLevel }
data Attention
= AttentiveTo {_getAttentiveTo :: IM.IntMap Awareness }
| Fixated {_getFixated :: Int }
data AwarenessLevel
data Awareness
= Suspicious Float
| Cognizant Float
deriving (Eq,Ord)
makeLenses ''AttentionDir
makeLenses ''PerceptionState
makeLenses ''Attention
makeLenses ''Perception
makeLenses ''Vision
makeLenses ''Audition