Attempt to make CWorld correct instance of Store
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
module Dodge.Data.Item.Combine where
|
||||
|
||||
import Control.Lens
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import qualified Data.Map.Strict as M
|
||||
@@ -219,3 +221,14 @@ 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) |]))
|
||||
|
||||
@@ -5,6 +5,8 @@ module Dodge.Data.Item.CurseStatus where
|
||||
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
|
||||
data CurseStatus
|
||||
= Uncursed
|
||||
@@ -13,3 +15,4 @@ data CurseStatus
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
deriveJSON defaultOptions ''CurseStatus
|
||||
$($(derive [d| instance Deriving (Store CurseStatus) |]))
|
||||
|
||||
@@ -6,6 +6,8 @@ module Dodge.Data.Item.Effect where
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
|
||||
data ItEffect = ItEffect
|
||||
{ _ieInv :: ItInvEffect --Item -> Creature -> World -> World
|
||||
@@ -27,9 +29,11 @@ data ItInvEffect
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data ItFloorEffect = NoFloorEffect
|
||||
| DefaultFloorEffect
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data ItDropEffect = NoDropEffect
|
||||
| DefaultDropEffect
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
makeLenses ''ItEffect
|
||||
@@ -37,3 +41,7 @@ deriveJSON defaultOptions ''ItEffect
|
||||
deriveJSON defaultOptions ''ItInvEffect
|
||||
deriveJSON defaultOptions ''ItFloorEffect
|
||||
deriveJSON defaultOptions ''ItDropEffect
|
||||
$($(derive [d| instance Deriving (Store ItEffect) |]))
|
||||
$($(derive [d| instance Deriving (Store ItInvEffect) |]))
|
||||
$($(derive [d| instance Deriving (Store ItFloorEffect) |]))
|
||||
$($(derive [d| instance Deriving (Store ItDropEffect) |]))
|
||||
|
||||
@@ -6,6 +6,8 @@ module Dodge.Data.Item.HeldDelay where
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
|
||||
data UseDelay -- should just be Delay
|
||||
= NoDelay
|
||||
@@ -27,3 +29,4 @@ data UseDelay -- should just be Delay
|
||||
|
||||
makeLenses ''UseDelay
|
||||
deriveJSON defaultOptions ''UseDelay
|
||||
$($(derive [d| instance Deriving (Store UseDelay) |]))
|
||||
|
||||
@@ -7,6 +7,8 @@ import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import qualified Data.Sequence as Seq
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
|
||||
data HeldScroll
|
||||
= HeldScrollDoNothing
|
||||
@@ -21,3 +23,4 @@ data HeldScroll
|
||||
|
||||
makeLenses ''HeldScroll
|
||||
deriveJSON defaultOptions ''HeldScroll
|
||||
$($(derive [d| instance Deriving (Store HeldScroll) |]))
|
||||
|
||||
@@ -7,6 +7,8 @@ import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import Dodge.Data.CamouflageStatus
|
||||
import Dodge.Data.Item.Combine
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
|
||||
data HeldUse
|
||||
= HeldDoNothing
|
||||
@@ -94,3 +96,8 @@ deriveJSON defaultOptions ''HeldMod
|
||||
deriveJSON defaultOptions ''Euse
|
||||
deriveJSON defaultOptions ''HeldUse
|
||||
deriveJSON defaultOptions ''Luse
|
||||
$($(derive [d| instance Deriving (Store Cuse) |]))
|
||||
$($(derive [d| instance Deriving (Store HeldMod) |]))
|
||||
$($(derive [d| instance Deriving (Store Euse) |]))
|
||||
$($(derive [d| instance Deriving (Store HeldUse) |]))
|
||||
$($(derive [d| instance Deriving (Store Luse) |]))
|
||||
|
||||
@@ -5,6 +5,8 @@ module Dodge.Data.Item.Location where
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
|
||||
data ItemLocation
|
||||
= InInv {_ipCrID :: Int, _ipInvID :: Int}
|
||||
@@ -15,3 +17,4 @@ data ItemLocation
|
||||
|
||||
makeLenses ''ItemLocation
|
||||
deriveJSON defaultOptions ''ItemLocation
|
||||
$($(derive [d| instance Deriving (Store ItemLocation) |]))
|
||||
|
||||
@@ -7,6 +7,9 @@ import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import Geometry.Data
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
import LinearHelp
|
||||
|
||||
data ItemDimension = ItemDimension
|
||||
{ _dimRad :: Float
|
||||
@@ -40,3 +43,7 @@ deriveJSON defaultOptions ''ItemDimension
|
||||
deriveJSON defaultOptions ''ItemPortage
|
||||
deriveJSON defaultOptions ''ItemValue
|
||||
deriveJSON defaultOptions ''ItemValueType
|
||||
$($(derive [d| instance Deriving (Store ItemDimension) |]))
|
||||
$($(derive [d| instance Deriving (Store ItemPortage) |]))
|
||||
$($(derive [d| instance Deriving (Store ItemValue) |]))
|
||||
$($(derive [d| instance Deriving (Store ItemValueType) |]))
|
||||
|
||||
@@ -10,6 +10,8 @@ import Data.Aeson.TH
|
||||
import Dodge.Data.ArcStep
|
||||
import Dodge.Data.Beam
|
||||
import Geometry.Data
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
|
||||
data ItemParams
|
||||
= NoParams
|
||||
@@ -113,3 +115,9 @@ deriveJSON defaultOptions ''PreviousArcEffect
|
||||
deriveJSON defaultOptions ''GunBarrels
|
||||
deriveJSON defaultOptions ''Nozzle
|
||||
deriveJSON defaultOptions ''BarrelSpread
|
||||
$($(derive [d| instance Deriving (Store ItemParams) |]))
|
||||
$($(derive [d| instance Deriving (Store ShrinkGunStatus) |]))
|
||||
$($(derive [d| instance Deriving (Store PreviousArcEffect) |]))
|
||||
$($(derive [d| instance Deriving (Store GunBarrels) |]))
|
||||
$($(derive [d| instance Deriving (Store Nozzle) |]))
|
||||
$($(derive [d| instance Deriving (Store BarrelSpread) |]))
|
||||
|
||||
@@ -7,6 +7,9 @@ import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import Geometry.Data
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
import LinearHelp
|
||||
|
||||
data Scope
|
||||
= NoScope
|
||||
@@ -30,3 +33,4 @@ data Scope
|
||||
|
||||
makeLenses ''Scope
|
||||
deriveJSON defaultOptions ''Scope
|
||||
$($(derive [d| instance Deriving (Store Scope) |]))
|
||||
|
||||
@@ -7,6 +7,9 @@ import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import Geometry.Data
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
import LinearHelp
|
||||
|
||||
data Targeting
|
||||
= NoTargeting
|
||||
@@ -38,3 +41,6 @@ makeLenses ''Targeting
|
||||
deriveJSON defaultOptions ''Targeting
|
||||
deriveJSON defaultOptions ''TargetUpdate
|
||||
deriveJSON defaultOptions ''TargetDraw
|
||||
$($(derive [d| instance Deriving (Store Targeting) |]))
|
||||
$($(derive [d| instance Deriving (Store TargetUpdate) |]))
|
||||
$($(derive [d| instance Deriving (Store TargetDraw) |]))
|
||||
|
||||
@@ -7,6 +7,8 @@ import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import qualified IntMapHelp as IM
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
|
||||
data ItemTweaks
|
||||
= NoTweaks
|
||||
@@ -35,3 +37,6 @@ makeLenses ''ItemTweaks
|
||||
deriveJSON defaultOptions ''ItemTweaks
|
||||
deriveJSON defaultOptions ''TweakType
|
||||
deriveJSON defaultOptions ''TweakParam
|
||||
$($(derive [d| instance Deriving (Store ItemTweaks) |]))
|
||||
$($(derive [d| instance Deriving (Store TweakType) |]))
|
||||
$($(derive [d| instance Deriving (Store TweakParam) |]))
|
||||
|
||||
@@ -20,6 +20,8 @@ import Dodge.Data.Item.HeldUse
|
||||
import Dodge.Data.Item.Use.Consumption
|
||||
import Dodge.Data.Item.Use.Equipment
|
||||
import Dodge.Data.Item.HeldDelay
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
|
||||
data ItemUse
|
||||
= HeldUse
|
||||
@@ -80,3 +82,8 @@ deriveJSON defaultOptions ''ItemUse
|
||||
deriveJSON defaultOptions ''AimParams
|
||||
deriveJSON defaultOptions ''AimStance
|
||||
deriveJSON defaultOptions ''ItZoom
|
||||
|
||||
$($(derive [d| instance Deriving (Store ItemUse) |]))
|
||||
$($(derive [d| instance Deriving (Store AimParams) |]))
|
||||
$($(derive [d| instance Deriving (Store AimStance) |]))
|
||||
$($(derive [d| instance Deriving (Store ItZoom) |]))
|
||||
|
||||
@@ -8,6 +8,8 @@ module Dodge.Data.Item.Use.Consumption (
|
||||
module Dodge.Data.Item.Use.Consumption.LoadAction,
|
||||
) where
|
||||
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
@@ -48,3 +50,6 @@ makeLenses ''ItAmount
|
||||
deriveJSON defaultOptions ''HeldConsumption
|
||||
deriveJSON defaultOptions ''LeftConsumption
|
||||
deriveJSON defaultOptions ''ItAmount
|
||||
$($(derive [d| instance Deriving (Store HeldConsumption) |]))
|
||||
$($(derive [d| instance Deriving (Store LeftConsumption) |]))
|
||||
$($(derive [d| instance Deriving (Store ItAmount) |]))
|
||||
|
||||
@@ -7,6 +7,8 @@ module Dodge.Data.Item.Use.Consumption.Ammo (
|
||||
module Dodge.Data.Payload,
|
||||
) where
|
||||
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
@@ -56,6 +58,7 @@ data AmmoType
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data ForceFieldType = DefaultForceField
|
||||
| HackForTemplateForceField
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data GasCreate = CreatePoisonGas | CreateFlame
|
||||
@@ -69,3 +72,9 @@ deriveJSON defaultOptions ''ProjectileUpdate
|
||||
deriveJSON defaultOptions ''AmmoType
|
||||
deriveJSON defaultOptions ''GasCreate
|
||||
deriveJSON defaultOptions ''ForceFieldType
|
||||
$($(derive [d| instance Deriving (Store ProjectileDraw) |]))
|
||||
$($(derive [d| instance Deriving (Store ProjectileCreate) |]))
|
||||
$($(derive [d| instance Deriving (Store ProjectileUpdate) |]))
|
||||
$($(derive [d| instance Deriving (Store AmmoType) |]))
|
||||
$($(derive [d| instance Deriving (Store GasCreate) |]))
|
||||
$($(derive [d| instance Deriving (Store ForceFieldType) |]))
|
||||
|
||||
@@ -8,6 +8,8 @@ import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import Dodge.Data.Hammer
|
||||
import Sound.Data
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
|
||||
data LoadAction
|
||||
= LoadEject {_actionTime :: Int, _actionSound :: SoundID}
|
||||
@@ -30,3 +32,6 @@ makeLenses ''InvSelAction
|
||||
deriveJSON defaultOptions ''LoadAction
|
||||
deriveJSON defaultOptions ''InvSel
|
||||
deriveJSON defaultOptions ''InvSelAction
|
||||
$($(derive [d| instance Deriving (Store LoadAction) |]))
|
||||
$($(derive [d| instance Deriving (Store InvSel) |]))
|
||||
$($(derive [d| instance Deriving (Store InvSelAction) |]))
|
||||
|
||||
@@ -11,6 +11,8 @@ import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import Dodge.Data.Equipment.Misc
|
||||
import Dodge.Data.Item.HeldUse
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
|
||||
data EquipEffect = EquipEffect
|
||||
{ _eeUse :: Euse --Item -> Creature -> World -> World
|
||||
@@ -32,3 +34,5 @@ makeLenses ''EquipEffect
|
||||
makeLenses ''EquipParams
|
||||
deriveJSON defaultOptions ''EquipEffect
|
||||
deriveJSON defaultOptions ''EquipParams
|
||||
$($(derive [d| instance Deriving (Store EquipEffect) |]))
|
||||
$($(derive [d| instance Deriving (Store EquipParams) |]))
|
||||
|
||||
Reference in New Issue
Block a user