Go back to JSON encoding

This commit is contained in:
2022-08-21 21:23:59 +01:00
parent dd62e30026
commit f1ef75f511
95 changed files with 9 additions and 586 deletions
-14
View File
@@ -5,9 +5,6 @@
module Dodge.Data.Item.Combine where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import Control.Lens
import Data.Aeson
@@ -225,14 +222,3 @@ deriveJSON defaultOptions ''ModuleSlot
makeLenses ''ItemType
makeLenses ''ItemBaseType
makeLenses ''HeldItemType
$($(derive [d| instance Deriving (Store ItemType ) |]))
$($(derive [d| instance Deriving (Store Stack ) |]))
$($(derive [d| instance Deriving (Store CraftType) |]))
$($(derive [d| instance Deriving (Store ItemBaseType) |]))
$($(derive [d| instance Deriving (Store ConsumableItemType) |]))
$($(derive [d| instance Deriving (Store EquipItemType) |]))
$($(derive [d| instance Deriving (Store LeftItemType) |]))
$($(derive [d| instance Deriving (Store HeldItemType) |]))
$($(derive [d| instance Deriving (Store ItemModuleType) |]))
$($(derive [d| instance Deriving (Store Detector) |]))
$($(derive [d| instance Deriving (Store ModuleSlot) |]))
-4
View File
@@ -5,9 +5,6 @@
module Dodge.Data.Item.CurseStatus where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import Data.Aeson
import Data.Aeson.TH
@@ -17,6 +14,5 @@ data CurseStatus
| UndroppableIdentified
| UndroppableUnidentified
deriving (Eq, Ord, Show, Read, Generic, Flat)
$($(derive [d| instance Deriving (Store CurseStatus) |]))
deriveJSON defaultOptions ''CurseStatus
-9
View File
@@ -5,9 +5,6 @@
module Dodge.Data.Item.Effect where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import Control.Lens
import Data.Aeson
@@ -31,14 +28,11 @@ data ItInvEffect
| RemoveShieldWall
| EffectWhileHeld ItInvEffect
deriving (Eq, Ord, Show, Read, Generic, Flat)
$($(derive [d| instance Deriving (Store ItInvEffect) |]))
data ItFloorEffect = NoFloorEffect
| HackItFloorEffect
deriving (Eq, Ord, Show, Read, Generic, Flat)
data ItDropEffect = NoDropEffect
| HackItDropEffect
deriving (Eq, Ord, Show, Read, Generic, Flat)
makeLenses ''ItEffect
@@ -46,6 +40,3 @@ deriveJSON defaultOptions ''ItEffect
deriveJSON defaultOptions ''ItInvEffect
deriveJSON defaultOptions ''ItFloorEffect
deriveJSON defaultOptions ''ItDropEffect
$($(derive [d| instance Deriving (Store ItEffect ) |]))
$($(derive [d| instance Deriving (Store ItDropEffect ) |]))
$($(derive [d| instance Deriving (Store ItFloorEffect ) |]))
-4
View File
@@ -5,9 +5,6 @@
module Dodge.Data.Item.HeldDelay where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import Control.Lens
import Data.Aeson
@@ -30,7 +27,6 @@ data UseDelay -- should just be Delay
, _warmMax :: Int
}
deriving (Eq, Ord, Show, Read, Generic, Flat)
$($(derive [d| instance Deriving (Store UseDelay ) |]))
makeLenses ''UseDelay
deriveJSON defaultOptions ''UseDelay
-4
View File
@@ -5,9 +5,6 @@
module Dodge.Data.Item.HeldScroll where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import Control.Lens
import Data.Aeson
@@ -24,7 +21,6 @@ data HeldScroll
, _hsMaxInt :: Int
}
deriving (Eq, Ord, Show, Read, Generic, Flat)
$($(derive [d| instance Deriving (Store HeldScroll) |]))
makeLenses ''HeldScroll
deriveJSON defaultOptions ''HeldScroll
-8
View File
@@ -5,9 +5,6 @@
module Dodge.Data.Item.HeldUse where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import Data.Aeson
import Data.Aeson.TH
@@ -31,13 +28,11 @@ data HeldUse
| HeldForceField
| HeldShatter
deriving (Eq, Ord, Show, Read, Generic, Flat)
$($(derive [d| instance Deriving (Store HeldUse) |]))
data Cuse
= CDoNothing
| CHeal Int
deriving (Eq, Ord, Show, Read, Generic, Flat)
$($(derive [d| instance Deriving (Store Cuse) |]))
data Euse
= EDoNothing
@@ -49,7 +44,6 @@ data Euse
| EonWristShield
| EoffWristShield
deriving (Eq, Ord, Show, Read, Generic, Flat)
$($(derive [d| instance Deriving (Store Euse) |]))
data Luse
= LDoNothing
@@ -59,7 +53,6 @@ data Luse
| LUnsafeBlink
| LBoost
deriving (Eq, Ord, Show, Read, Generic, Flat)
$($(derive [d| instance Deriving (Store Luse) |]))
data HeldMod
= HeldModNothing
@@ -98,7 +91,6 @@ data HeldMod
| RevolverXRepeatMod
| BangConeMod
deriving (Eq, Ord, Show, Read, Generic, Flat)
$($(derive [d| instance Deriving (Store HeldMod) |]))
deriveJSON defaultOptions ''Cuse
deriveJSON defaultOptions ''HeldMod
-4
View File
@@ -4,9 +4,6 @@
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.Item.Location where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import Control.Lens
import Data.Aeson
@@ -18,7 +15,6 @@ data ItemLocation
| OnFloor {_ipFlID :: Int}
| InVoid
deriving (Eq, Show, Read, Ord, Generic, Flat)
$($(derive [d| instance Deriving (Store ItemLocation) |]))
makeLenses ''ItemLocation
deriveJSON defaultOptions ''ItemLocation
-7
View File
@@ -5,9 +5,6 @@
module Dodge.Data.Item.Misc where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import Control.Lens
import Data.Aeson
@@ -21,7 +18,6 @@ data ItemDimension = ItemDimension
, _dimAttachPos :: Point3
}
deriving (Eq, Show, Read, Generic, Flat)
$($(derive [d| instance Deriving (Store ItemDimension ) |]))
data ItemPortage
= HeldItem
@@ -31,18 +27,15 @@ data ItemPortage
| WornItem
| NoPortage
deriving (Eq, Show, Read, Generic, Flat)
$($(derive [d| instance Deriving (Store ItemPortage) |]))
--data ItemValue = ItemValue
-- { _ivInt :: Int
-- , _ivType :: ItemValueType
-- }
-- deriving (Eq, Show, Read, Generic, Flat)
-- $($(derive [d| instance Deriving (Store ItemValue ) |]))
--
--data ItemValueType = MundaneItem | ArtefactItem
-- deriving (Eq, Show, Read, Generic, Flat)
-- $($(derive [d| instance Deriving (Store ItemValueType ) |]))
makeLenses ''ItemDimension
makeLenses ''ItemPortage
-9
View File
@@ -5,9 +5,6 @@
module Dodge.Data.Item.Params where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import Color
import Control.Lens
@@ -119,9 +116,3 @@ deriveJSON defaultOptions ''PreviousArcEffect
deriveJSON defaultOptions ''GunBarrels
deriveJSON defaultOptions ''Nozzle
deriveJSON defaultOptions ''BarrelSpread
$($(derive [d| instance Deriving (Store PreviousArcEffect ) |]))
$($(derive [d| instance Deriving (Store GunBarrels) |]))
$($(derive [d| instance Deriving (Store Nozzle ) |]))
$($(derive [d| instance Deriving (Store BarrelSpread) |]))
$($(derive [d| instance Deriving (Store ItemParams) |]))
$($(derive [d| instance Deriving (Store ShrinkGunStatus ) |]))
-4
View File
@@ -5,9 +5,6 @@
module Dodge.Data.Item.Scope where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import Control.Lens
import Data.Aeson
@@ -34,7 +31,6 @@ data Scope
_scopeIsCamera :: Bool
}
deriving (Eq, Show, Read, Generic, Flat)
$($(derive [d| instance Deriving (Store Scope) |]))
makeLenses ''Scope
deriveJSON defaultOptions ''Scope
-6
View File
@@ -5,9 +5,6 @@
module Dodge.Data.Item.Targeting where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import Control.Lens
import Data.Aeson
@@ -45,6 +42,3 @@ makeLenses ''Targeting
deriveJSON defaultOptions ''Targeting
deriveJSON defaultOptions ''TargetUpdate
deriveJSON defaultOptions ''TargetDraw
$($(derive [d| instance Deriving (Store Targeting) |]))
$($(derive [d| instance Deriving (Store TargetDraw) |]))
$($(derive [d| instance Deriving (Store TargetUpdate) |]))
-6
View File
@@ -5,9 +5,6 @@
module Dodge.Data.Item.Tweak where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import Control.Lens
import Data.Aeson
@@ -35,12 +32,9 @@ data TweakParam = TweakParam
, _tweakMax :: Int
}
deriving (Eq, Show, Read, Generic, Flat)
$($(derive [d| instance Deriving (Store TweakParam ) |]))
makeLenses ''TweakParam
makeLenses ''ItemTweaks
deriveJSON defaultOptions ''ItemTweaks
deriveJSON defaultOptions ''TweakType
deriveJSON defaultOptions ''TweakParam
$($(derive [d| instance Deriving (Store ItemTweaks) |]))
$($(derive [d| instance Deriving (Store TweakType) |]))
-7
View File
@@ -13,9 +13,6 @@ module Dodge.Data.Item.Use (
module Dodge.Data.Hammer,
) where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import Control.Lens
import Data.Aeson
@@ -86,7 +83,3 @@ deriveJSON defaultOptions ''ItemUse
deriveJSON defaultOptions ''AimParams
deriveJSON defaultOptions ''AimStance
deriveJSON defaultOptions ''ItZoom
$($(derive [d| instance Deriving (Store AimParams ) |]))
$($(derive [d| instance Deriving (Store AimStance) |]))
$($(derive [d| instance Deriving (Store ItZoom ) |]))
$($(derive [d| instance Deriving (Store ItemUse) |]))
-6
View File
@@ -11,9 +11,6 @@ module Dodge.Data.Item.Use.Consumption (
module Dodge.Data.Item.Use.Consumption.LoadAction,
) where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import Control.Lens
import Data.Aeson
@@ -32,7 +29,6 @@ data HeldConsumption
}
| NoConsumption
deriving (Eq, Show, Read, Generic, Flat)
$($(derive [d| instance Deriving (Store HeldConsumption) |]))
data LeftConsumption
= AutoRecharging
@@ -46,14 +42,12 @@ data LeftConsumption
, _wpCharge :: Int
}
deriving (Eq, Show, Read, Generic, Flat)
$($(derive [d| instance Deriving (Store LeftConsumption) |]))
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)
$($(derive [d| instance Deriving (Store ItAmount) |]))
makeLenses ''HeldConsumption
makeLenses ''LeftConsumption
@@ -9,9 +9,6 @@ module Dodge.Data.Item.Use.Consumption.Ammo (
module Dodge.Data.Payload,
) where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import Control.Lens
import Data.Aeson
@@ -62,7 +59,6 @@ data AmmoType
deriving (Eq, Ord, Show, Read, Generic, Flat)
data ForceFieldType = DefaultForceField
| HackForceFieldType
deriving (Eq, Ord, Show, Read, Generic, Flat)
data GasCreate = CreatePoisonGas | CreateFlame
@@ -76,9 +72,3 @@ deriveJSON defaultOptions ''ProjectileUpdate
deriveJSON defaultOptions ''AmmoType
deriveJSON defaultOptions ''GasCreate
deriveJSON defaultOptions ''ForceFieldType
$($(derive [d| instance Deriving (Store AmmoType) |]))
$($(derive [d| instance Deriving (Store ProjectileDraw ) |]))
$($(derive [d| instance Deriving (Store ProjectileCreate ) |]))
$($(derive [d| instance Deriving (Store ProjectileUpdate) |]))
$($(derive [d| instance Deriving (Store ForceFieldType ) |]))
$($(derive [d| instance Deriving (Store GasCreate ) |]))
@@ -5,9 +5,6 @@
module Dodge.Data.Item.Use.Consumption.LoadAction where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import Control.Lens
import Data.Aeson
@@ -36,6 +33,3 @@ makeLenses ''InvSelAction
deriveJSON defaultOptions ''LoadAction
deriveJSON defaultOptions ''InvSel
deriveJSON defaultOptions ''InvSelAction
$($(derive [d| instance Deriving (Store LoadAction) |]))
$($(derive [d| instance Deriving (Store InvSelAction) |]))
$($(derive [d| instance Deriving (Store InvSel ) |]))
-5
View File
@@ -8,9 +8,6 @@ module Dodge.Data.Item.Use.Equipment (
module Dodge.Data.Item.Use.Equipment,
) where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import Control.Lens
import Data.Aeson
@@ -38,5 +35,3 @@ makeLenses ''EquipEffect
makeLenses ''EquipParams
deriveJSON defaultOptions ''EquipEffect
deriveJSON defaultOptions ''EquipParams
$($(derive [d| instance Deriving (Store EquipEffect ) |]))
$($(derive [d| instance Deriving (Store EquipParams) |]))