Move from store to flat

This commit is contained in:
2022-08-20 17:54:35 +01:00
parent 8571ab9254
commit ff9dbdf068
95 changed files with 793 additions and 748 deletions
+9 -12
View File
@@ -1,3 +1,5 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
@@ -21,6 +23,7 @@ module Dodge.Data.Creature.Perception (
auDist,
) where
import Flat
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
@@ -36,18 +39,18 @@ data Perception = Perception
, _cpVision :: Vision
, _cpAudition :: Audition
}
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data Vision = Eyes
{ _viFOV :: FloatFloat
, _viDist :: FloatFloat
}
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
newtype Audition = Ears
{ _auDist :: FloatFloat
}
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data Vigilance
= Comatose
@@ -55,17 +58,17 @@ data Vigilance
| Lethargic
| Vigilant
| Overstrung
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data Attention
= AttentiveTo {_getAttentiveTo :: IM.IntMap Awareness}
| Fixated {_getFixated :: Int}
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data Awareness
= Suspicious Float
| Cognizant Float
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
makeLenses ''Perception
makeLenses ''Vision
@@ -77,9 +80,3 @@ deriveJSON defaultOptions ''Audition
deriveJSON defaultOptions ''Vigilance
deriveJSON defaultOptions ''Attention
deriveJSON defaultOptions ''Awareness
$($(derive [d| instance Deriving (Store Perception) |]))
$($(derive [d| instance Deriving (Store Vision) |]))
$($(derive [d| instance Deriving (Store Audition) |]))
$($(derive [d| instance Deriving (Store Vigilance) |]))
$($(derive [d| instance Deriving (Store Attention) |]))
$($(derive [d| instance Deriving (Store Awareness) |]))