{-# 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
    }
newtype 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
