Refactor, try to limit dependencies
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.Projectile where
|
||||
import GHC.Generics
|
||||
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Dodge.Data.Payload
|
||||
import Data.Aeson.TH
|
||||
import Dodge.Data.Item.Use.Consumption.Ammo
|
||||
import Geometry.Data
|
||||
import Control.Lens
|
||||
--data ProjectileType = ShellType
|
||||
|
||||
data Proj
|
||||
= RemoteShell
|
||||
= RemoteShell
|
||||
{ _prjPos :: Point2
|
||||
, _prjStartPos :: Point2
|
||||
, _prjVel :: Point2
|
||||
@@ -19,7 +19,7 @@ data Proj
|
||||
, _prjPayload :: Payload
|
||||
, _prjMITID :: Maybe Int
|
||||
}
|
||||
| Shell
|
||||
| Shell
|
||||
{ _prjPos :: Point2
|
||||
, _prjStartPos :: Point2
|
||||
, _prjVel :: Point2
|
||||
@@ -34,8 +34,7 @@ data Proj
|
||||
, _prjUpdates :: [ProjectileUpdate]
|
||||
, _prjMITID :: Maybe Int
|
||||
}
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON Proj where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON Proj
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
makeLenses ''Proj
|
||||
deriveJSON defaultOptions ''Proj
|
||||
|
||||
Reference in New Issue
Block a user