Refactor, try to limit dependencies
This commit is contained in:
+14
-15
@@ -1,27 +1,26 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.Corpse where
|
||||
import GHC.Generics
|
||||
import Data.Aeson
|
||||
import ShapePicture.Data
|
||||
import Geometry.Data
|
||||
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import Geometry.Data
|
||||
import ShapePicture.Data
|
||||
|
||||
data CorpseResurrection = NoResurrection
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON CorpseResurrection where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON CorpseResurrection
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data Corpse = Corpse
|
||||
{ _cpID :: Int
|
||||
{ _cpID :: Int
|
||||
, _cpPos :: Point2
|
||||
, _cpDir :: Float
|
||||
, _cpSPic :: SPic
|
||||
, _cpRes :: CorpseResurrection
|
||||
}
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON Corpse where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON Corpse
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
makeLenses ''Corpse
|
||||
deriveJSON defaultOptions ''CorpseResurrection
|
||||
deriveJSON defaultOptions ''Corpse
|
||||
|
||||
Reference in New Issue
Block a user