Add Store instances
This commit is contained in:
@@ -17,6 +17,8 @@ module Dodge.Data.Creature (
|
||||
module Dodge.Data.Hammer,
|
||||
) where
|
||||
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
import Data.Binary
|
||||
import Flat
|
||||
import LinearHelp ()
|
||||
@@ -77,11 +79,10 @@ data Creature = Creature
|
||||
, _crCamouflage :: CamouflageStatus
|
||||
}
|
||||
deriving (Eq, Show, Read, Generic, Flat)
|
||||
instance Binary Creature
|
||||
|
||||
data CreatureCorpse = MakeDefaultCorpse
|
||||
| HackCreatureCorpse
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary CreatureCorpse
|
||||
|
||||
data Intention = Intention
|
||||
{ _targetCr :: Maybe Creature
|
||||
@@ -89,7 +90,6 @@ data Intention = Intention
|
||||
, _viewPoint :: Maybe Point2
|
||||
}
|
||||
deriving (Eq, Show, Read, Generic, Flat)
|
||||
instance Binary Intention
|
||||
|
||||
crSel :: Creature -> Int
|
||||
crSel = _iselPos . _crInvSel
|
||||
@@ -99,3 +99,6 @@ makeLenses ''Intention
|
||||
deriveJSON defaultOptions ''Creature
|
||||
deriveJSON defaultOptions ''CreatureCorpse
|
||||
deriveJSON defaultOptions ''Intention
|
||||
$($(derive [d| instance Deriving (Store Intention ) |]))
|
||||
$($(derive [d| instance Deriving (Store Creature ) |]))
|
||||
$($(derive [d| instance Deriving (Store CreatureCorpse ) |]))
|
||||
|
||||
Reference in New Issue
Block a user