Create new files

This commit is contained in:
2021-09-08 17:41:40 +01:00
parent 643cd5a420
commit f3c5e3a177
5 changed files with 277 additions and 0 deletions
+61
View File
@@ -0,0 +1,61 @@
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE StrictData #-}
module Dodge.Creature.Perception.Data
( PerceptionState (..)
, AwakeLevel (..)
, AttentionDir (..)
, AwarenessLevel (..)
, Vision (..)
, Audition (..)
-- lenses
, getAttentiveTo
, getFixated
, crAttentionDir
, crAwakeLevel
, crAwarenessLevel
, crVision
, crAudition
, viFOV
, viDist
, auDist
)
where
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 Vision = Eyes
{ _viFOV :: Float -> Float
, _viDist :: Float -> Float
}
data Audition = Ears
{ _auDist :: Float -> Float
}
data AwakeLevel
= Comatose
| Asleep
| Lethargic
| Vigilant
| Overstrung
deriving (Eq,Ord,Show)
data AttentionDir
= AttentiveTo {_getAttentiveTo :: IM.IntMap AwarenessLevel }
| Fixated {_getFixated :: Int }
data AwarenessLevel
= Suspicious Float
| Cognizant Float
makeLenses ''AttentionDir
makeLenses ''PerceptionState
makeLenses ''Vision
makeLenses ''Audition