{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE StrictData #-}
module Dodge.Creature.Perception.Data
    ( Perception (..)
    , Vigilance (..)
    , Attention (..)
    , Awareness (..)
    , Vision (..)
    , Audition (..)
    -- lenses
    , getAttentiveTo
    , getFixated
    , cpAttention
    , cpVigilance
    , cpAwareness
    , cpVision
    , cpAudition
    , viFOV
    , viDist
    , auDist
    )
    where
import Control.Lens
import qualified Data.IntMap as IM

data Perception = Perception
    { _cpVigilance     :: Vigilance
    , _cpAttention     :: Attention
    , _cpAwareness     :: IM.IntMap Awareness
    , _cpVision         :: Vision
    , _cpAudition       :: Audition
    }

data Vision = Eyes
    { _viFOV  :: Float -> Float
    , _viDist :: Float -> Float
    }
newtype Audition = Ears
    { _auDist :: Float -> Float
    }

data Vigilance
    = Comatose
    | Asleep
    | Lethargic
    | Vigilant
    | Overstrung
  deriving (Eq,Ord,Show)

data Attention
    = AttentiveTo {_getAttentiveTo :: IM.IntMap Awareness }
    | Fixated {_getFixated :: Int }

data Awareness
    = Suspicious Float
    | Cognizant Float
  deriving (Eq,Ord)

makeLenses ''Attention
makeLenses ''Perception
makeLenses ''Vision
makeLenses ''Audition
