Refactor, try to limit dependencies
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
module Dodge.Data.PressPlate
|
||||
where
|
||||
import GHC.Generics
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.PressPlate where
|
||||
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import Geometry.Data
|
||||
import Picture
|
||||
import Control.Lens
|
||||
data PressPlateEvent = PressPlateId
|
||||
|
||||
data PressPlateEvent
|
||||
= PressPlateId
|
||||
| PPLevelReset
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON PressPlateEvent where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON PressPlateEvent
|
||||
data PressPlate = PressPlate
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data PressPlate = PressPlate
|
||||
{ _ppPict :: Picture
|
||||
, _ppPos :: Point2
|
||||
, _ppRot :: Float
|
||||
@@ -22,8 +22,8 @@ data PressPlate = PressPlate
|
||||
, _ppID :: Int
|
||||
, _ppText :: String
|
||||
}
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON PressPlate where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON PressPlate
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
makeLenses ''PressPlate
|
||||
deriveJSON defaultOptions ''PressPlateEvent
|
||||
deriveJSON defaultOptions ''PressPlate
|
||||
|
||||
Reference in New Issue
Block a user