Add Store instances
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
|
||||
module Dodge.Data.Creature.Memory where
|
||||
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
import Data.Binary
|
||||
import Flat
|
||||
import LinearHelp ()
|
||||
@@ -18,7 +20,7 @@ data Memory = Memory
|
||||
, _nodesSearched :: [Int]
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary Memory
|
||||
$($(derive [d| instance Deriving (Store Memory ) |]))
|
||||
|
||||
makeLenses ''Memory
|
||||
deriveJSON defaultOptions ''Memory
|
||||
|
||||
@@ -8,6 +8,8 @@ module Dodge.Data.Creature.Misc (
|
||||
module Dodge.Data.CamouflageStatus,
|
||||
) where
|
||||
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
import Data.Binary
|
||||
import Flat
|
||||
import Color
|
||||
@@ -25,7 +27,6 @@ data CreatureStatistics = CreatureStatistics
|
||||
, _intelligence :: Int
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary CreatureStatistics
|
||||
|
||||
data Vocalization
|
||||
= Mute
|
||||
@@ -36,7 +37,6 @@ data Vocalization
|
||||
, _vcCoolDown :: Int
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary Vocalization
|
||||
|
||||
data CrMvType
|
||||
= NoMvType
|
||||
@@ -48,7 +48,6 @@ data CrMvType
|
||||
, _mvAimSpeed :: FloatFloat
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary CrMvType
|
||||
|
||||
data HumanoidAI
|
||||
= YourAI
|
||||
@@ -65,7 +64,6 @@ data HumanoidAI
|
||||
| LongAI
|
||||
| MultGunAI
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary HumanoidAI
|
||||
|
||||
data CreatureType
|
||||
= Humanoid
|
||||
@@ -78,11 +76,9 @@ data CreatureType
|
||||
| Lampoid {_lampHeight :: Float, _lampColor :: Point3, _lampLSID :: Maybe Int}
|
||||
| NonDrawnCreature
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary CreatureType
|
||||
|
||||
data BarrelType = PlainBarrel | ExplosiveBarrel
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary BarrelType
|
||||
|
||||
makeLenses ''CreatureStatistics
|
||||
makeLenses ''Vocalization
|
||||
@@ -94,3 +90,9 @@ deriveJSON defaultOptions ''CrMvType
|
||||
deriveJSON defaultOptions ''HumanoidAI
|
||||
deriveJSON defaultOptions ''CreatureType
|
||||
deriveJSON defaultOptions ''BarrelType
|
||||
$($(derive [d| instance Deriving (Store CrMvType) |]))
|
||||
$($(derive [d| instance Deriving (Store HumanoidAI) |]))
|
||||
$($(derive [d| instance Deriving (Store CreatureType) |]))
|
||||
$($(derive [d| instance Deriving (Store BarrelType ) |]))
|
||||
$($(derive [d| instance Deriving (Store CreatureStatistics ) |]))
|
||||
$($(derive [d| instance Deriving (Store Vocalization) |]))
|
||||
|
||||
@@ -23,6 +23,8 @@ module Dodge.Data.Creature.Perception (
|
||||
auDist,
|
||||
) where
|
||||
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
import Data.Binary
|
||||
import Flat
|
||||
import Control.Lens
|
||||
@@ -39,20 +41,17 @@ data Perception = Perception
|
||||
, _cpAudition :: Audition
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary Perception
|
||||
|
||||
data Vision = Eyes
|
||||
{ _viFOV :: FloatFloat
|
||||
, _viDist :: FloatFloat
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary Vision
|
||||
|
||||
newtype Audition = Ears
|
||||
{ _auDist :: FloatFloat
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary Audition
|
||||
|
||||
data Vigilance
|
||||
= Comatose
|
||||
@@ -61,19 +60,17 @@ data Vigilance
|
||||
| Vigilant
|
||||
| Overstrung
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary Vigilance
|
||||
|
||||
data Attention
|
||||
= AttentiveTo {_getAttentiveTo :: IM.IntMap Awareness}
|
||||
| Fixated {_getFixated :: Int}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary Attention
|
||||
|
||||
data Awareness
|
||||
= Suspicious Float
|
||||
| Cognizant Float
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary Awareness
|
||||
$($(derive [d| instance Deriving (Store Awareness) |]))
|
||||
|
||||
makeLenses ''Perception
|
||||
makeLenses ''Vision
|
||||
@@ -85,3 +82,8 @@ 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) |]))
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
module Dodge.Data.Creature.Stance where
|
||||
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
import Data.Binary
|
||||
import Flat
|
||||
import LinearHelp ()
|
||||
@@ -19,7 +21,6 @@ data Stance = Stance
|
||||
, _strideLength :: Int
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary Stance
|
||||
|
||||
data Carriage
|
||||
= Walking
|
||||
@@ -31,7 +32,6 @@ data Carriage
|
||||
| Flying
|
||||
| Boosting Point2
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary Carriage
|
||||
|
||||
data FootForward
|
||||
= LeftForward
|
||||
@@ -39,13 +39,12 @@ data FootForward
|
||||
| WasLeftForward
|
||||
| WasRightForward
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary FootForward
|
||||
|
||||
data Posture
|
||||
= Aiming
|
||||
| AtEase
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary Posture
|
||||
$($(derive [d| instance Deriving (Store Posture) |]))
|
||||
|
||||
makeLenses ''Stance
|
||||
makeLenses ''Carriage
|
||||
@@ -54,3 +53,6 @@ deriveJSON defaultOptions ''Stance
|
||||
deriveJSON defaultOptions ''Carriage
|
||||
deriveJSON defaultOptions ''FootForward
|
||||
deriveJSON defaultOptions ''Posture
|
||||
$($(derive [d| instance Deriving (Store Stance ) |]))
|
||||
$($(derive [d| instance Deriving (Store Carriage) |]))
|
||||
$($(derive [d| instance Deriving (Store FootForward) |]))
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
module Dodge.Data.Creature.State where
|
||||
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
import Data.Binary
|
||||
import Flat
|
||||
import Color
|
||||
@@ -21,20 +23,17 @@ data CreatureState = CrSt
|
||||
, _csDropsOnDeath :: CreatureDropType
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary CreatureState
|
||||
|
||||
data CreatureDropType
|
||||
= DropAll
|
||||
| DropAmount Int
|
||||
| DropSpecific [Int]
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary CreatureDropType
|
||||
|
||||
data CrSpState
|
||||
= Barrel {_piercedPoints :: [Point2]}
|
||||
| GenCr
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary CrSpState
|
||||
|
||||
data Faction
|
||||
= GenericFaction Int
|
||||
@@ -46,7 +45,6 @@ data Faction
|
||||
| ColorFaction Color
|
||||
| PlayerFaction
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary Faction
|
||||
|
||||
data CrGroup
|
||||
= LoneWolf
|
||||
@@ -57,7 +55,6 @@ data CrGroup
|
||||
| CrGroupID {_crGroupID :: Int}
|
||||
| ShieldGroup
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary CrGroup
|
||||
|
||||
makeLenses ''CreatureState
|
||||
makeLenses ''CrSpState
|
||||
@@ -67,3 +64,8 @@ deriveJSON defaultOptions ''CreatureDropType
|
||||
deriveJSON defaultOptions ''CrSpState
|
||||
deriveJSON defaultOptions ''Faction
|
||||
deriveJSON defaultOptions ''CrGroup
|
||||
$($(derive [d| instance Deriving (Store CreatureState ) |]))
|
||||
$($(derive [d| instance Deriving (Store CreatureDropType) |]))
|
||||
$($(derive [d| instance Deriving (Store CrSpState) |]))
|
||||
$($(derive [d| instance Deriving (Store Faction) |]))
|
||||
$($(derive [d| instance Deriving (Store CrGroup) |]))
|
||||
|
||||
Reference in New Issue
Block a user