Add generic derivations and To/FromJSON instances
This commit is contained in:
@@ -1,14 +1,19 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
module Dodge.Data.Creature.State where
|
||||
import GHC.Generics
|
||||
import Data.Aeson
|
||||
import Dodge.Data.Damage
|
||||
import Dodge.Creature.State.Data
|
||||
import Control.Lens
|
||||
|
||||
data CreatureState = CrSt
|
||||
{ _csDamage :: [Damage]
|
||||
, _csSpState :: CrSpState
|
||||
, _csDropsOnDeath :: CreatureDropType
|
||||
}
|
||||
deriving (Eq,Ord,Show,Read)
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON CreatureState where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON CreatureState
|
||||
makeLenses ''CreatureState
|
||||
|
||||
Reference in New Issue
Block a user