Cleanup, remove records, stop unecessary Aeson compile
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
--{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.AmmoType where
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ data Bullet = Bullet
|
||||
, _buPos :: Point2
|
||||
, _buOldPos :: Point2
|
||||
, _buWidth :: Float
|
||||
, _buDamages :: [Damage]
|
||||
-- , _buDamages :: [Damage]
|
||||
}
|
||||
deriving (Show, Eq, Ord, Read) --Generic, Flat)
|
||||
|
||||
@@ -42,7 +42,7 @@ data BulletEffect
|
||||
|
||||
data BulletPayload
|
||||
= BulBall {_spawnEBT :: EnergyBallType}
|
||||
| BulSpark
|
||||
| BulPlain {_sparkDam :: Int}
|
||||
| BulFlak
|
||||
| BulFrag
|
||||
| BulGas
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
{-# LANGUAGE DeriveAnyClass #-}
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE DerivingStrategies #-}
|
||||
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.CombAmount where
|
||||
|
||||
import Control.Lens
|
||||
|
||||
newtype CombAmount = CombAmount {_getCombAmount :: Int}
|
||||
deriving newtype (Eq, Ord, Read, Show, Num, Real, Enum, Integral)
|
||||
|
||||
makeLenses ''CombAmount
|
||||
|
||||
@@ -14,8 +14,10 @@ module Dodge.Data.Creature (
|
||||
module Dodge.Data.ActionPlan,
|
||||
module Dodge.Data.Item,
|
||||
module Dodge.Data.Material,
|
||||
module Dodge.Data.Item.Use.Consumption.LoadAction,
|
||||
) where
|
||||
|
||||
import Dodge.Data.Item.Use.Consumption.LoadAction
|
||||
import Dodge.Data.Equipment.Misc
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
|
||||
@@ -16,16 +16,9 @@ import Geometry.Data
|
||||
data CreatureState = CrSt
|
||||
{ _csDamage :: [Damage]
|
||||
, _csSpState :: CrSpState
|
||||
-- , _csDropsOnDeath :: CreatureDropType
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
data CreatureDropType
|
||||
= DropAll
|
||||
| DropAmount Int
|
||||
| DropSpecific [Int]
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
data CrSpState
|
||||
= Barrel {_piercedPoints :: [Point2]}
|
||||
| GenCr
|
||||
@@ -55,7 +48,6 @@ data CrGroup
|
||||
makeLenses ''CreatureState
|
||||
makeLenses ''CrSpState
|
||||
makeLenses ''CrGroup
|
||||
deriveJSON defaultOptions ''CreatureDropType
|
||||
deriveJSON defaultOptions ''CrSpState
|
||||
deriveJSON defaultOptions ''Faction
|
||||
deriveJSON defaultOptions ''CrGroup
|
||||
|
||||
@@ -29,12 +29,12 @@ import NewInt
|
||||
data ItID = ItID
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data Consumables
|
||||
= NoConsumables
|
||||
| AmmoMag
|
||||
{ _magLoadStatus :: ReloadStatus
|
||||
}
|
||||
deriving (Eq, Show, Read)
|
||||
--data Consumables
|
||||
-- = NoConsumables
|
||||
-- | AmmoMag
|
||||
-- { _magLoadStatus :: ReloadStatus
|
||||
-- }
|
||||
-- deriving (Eq, Show, Read)
|
||||
|
||||
data Item = Item
|
||||
{ _itUse :: ItemUse
|
||||
@@ -61,11 +61,11 @@ data ItemTargeting = NoItTargeting
|
||||
}
|
||||
|
||||
makeLenses ''ItemTargeting
|
||||
makeLenses ''Consumables
|
||||
--makeLenses ''Consumables
|
||||
makeLenses ''Item
|
||||
makeLenses ''ItemScroll
|
||||
deriveJSON defaultOptions ''ItemScroll
|
||||
deriveJSON defaultOptions ''Consumables
|
||||
--deriveJSON defaultOptions ''Consumables
|
||||
deriveJSON defaultOptions ''ItemTargeting
|
||||
deriveJSON defaultOptions ''ItID
|
||||
deriveJSON defaultOptions ''Item
|
||||
|
||||
@@ -5,24 +5,27 @@
|
||||
|
||||
module Dodge.Data.Item.Use (
|
||||
module Dodge.Data.Item.Use,
|
||||
module Dodge.Data.Item.Use.Consumption,
|
||||
module Dodge.Data.Item.Targeting,
|
||||
module Dodge.Data.GenFloat,
|
||||
module Dodge.Data.Item.Scope,
|
||||
module Dodge.Data.Item.BulletMod,
|
||||
module Dodge.Data.Payload
|
||||
module Dodge.Data.Payload,
|
||||
module Dodge.Data.Bullet,
|
||||
module Dodge.Data.Item.Use.Consumption.Ammo,
|
||||
) where
|
||||
|
||||
import Dodge.Data.Payload
|
||||
import Dodge.Data.Item.Use.Consumption.Ammo
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import qualified Data.Set as S
|
||||
import Dodge.Data.Bullet
|
||||
import Dodge.Data.GenFloat
|
||||
import Dodge.Data.Item.BulletMod
|
||||
import Dodge.Data.Item.Scope
|
||||
import Dodge.Data.Item.Targeting
|
||||
import Dodge.Data.Item.Use.Consumption
|
||||
import Dodge.Data.Payload
|
||||
--import Dodge.Data.Item.Use.Consumption
|
||||
import Geometry.Data
|
||||
|
||||
data ItemUse
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
{-# LANGUAGE DeriveAnyClass #-}
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE DerivingStrategies #-}
|
||||
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.Item.Use.Consumption (
|
||||
module Dodge.Data.Item.Use.Consumption,
|
||||
module Dodge.Data.Item.Use.Consumption.Ammo,
|
||||
module Dodge.Data.Item.Use.Consumption.LoadAction,
|
||||
) where
|
||||
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import Dodge.Data.Item.Use.Consumption.Ammo
|
||||
import Dodge.Data.Item.Use.Consumption.LoadAction
|
||||
|
||||
data ReloadStatus = ReloadStatus
|
||||
{ _iaLoaded :: Int
|
||||
}
|
||||
deriving (Eq, Show, Read) --Generic, Flat)
|
||||
|
||||
data LeftConsumption
|
||||
= AutoRecharging
|
||||
{ _arLoaded :: Int
|
||||
, _arMax :: Int
|
||||
, _arTime :: Int
|
||||
, _arProgress :: Int
|
||||
}
|
||||
| ChargeableAmmo
|
||||
{ _wpMaxCharge :: Int
|
||||
, _wpCharge :: Int
|
||||
}
|
||||
deriving (Eq, Show, Read) --Generic, Flat)
|
||||
|
||||
newtype ItAmount = ItAmount {_getItAmount :: Int}
|
||||
-- deriving (Eq, Ord, Read Show, Num, Real,) --Generic, Flat)
|
||||
deriving newtype (Eq, Ord, Read, Show, Num, Real, Enum, Integral)
|
||||
|
||||
-- deriving stock (Generic)
|
||||
-- deriving anyclass (Flat)
|
||||
|
||||
makeLenses ''LeftConsumption
|
||||
makeLenses ''ItAmount
|
||||
makeLenses ''ReloadStatus
|
||||
deriveJSON defaultOptions ''ReloadStatus
|
||||
deriveJSON defaultOptions ''LeftConsumption
|
||||
deriveJSON defaultOptions ''ItAmount
|
||||
@@ -104,8 +104,7 @@ data LWorld = LWorld
|
||||
, _gusts :: IM.IntMap Gust
|
||||
, _props :: IM.IntMap Prop
|
||||
, _projectiles :: IM.IntMap Projectile
|
||||
, -- , _instantBullets :: [Bullet]
|
||||
_bullets :: [Bullet]
|
||||
, _bullets :: [Bullet]
|
||||
, _radarSweeps :: [RadarSweep]
|
||||
, _energyBalls :: [EnergyBall]
|
||||
, _posEvents :: [PosEvent]
|
||||
@@ -117,8 +116,7 @@ data LWorld = LWorld
|
||||
, _arcNode :: M.Map ArcNodeType Int
|
||||
, _shockwaves :: [Shockwave]
|
||||
, _lasers :: [Laser]
|
||||
, -- , _lasersToDraw :: [Laser]
|
||||
_linearShockwaves :: IM.IntMap LinearShockwave
|
||||
, _linearShockwaves :: IM.IntMap LinearShockwave
|
||||
, _tractorBeams :: [TractorBeam]
|
||||
, _walls :: IM.IntMap Wall
|
||||
, _wallDamages :: IM.IntMap [Damage]
|
||||
|
||||
@@ -14,9 +14,9 @@ data LightSourceDraw = DefaultLightSourceDraw
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
data LSParam = LSParam -- LSPosRadCol
|
||||
{ _lsPos :: !Point3
|
||||
, _lsRad :: !Float
|
||||
, _lsCol :: !Point3
|
||||
{ _lsPos :: Point3
|
||||
, _lsRad :: Float
|
||||
, _lsCol :: Point3
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user