Attempt to make CWorld correct instance of Store
This commit is contained in:
@@ -1,8 +1,13 @@
|
|||||||
{-# LANGUAGE DeriveGeneric #-}
|
{-# LANGUAGE DeriveGeneric #-}
|
||||||
|
{-# LANGUAGE StrictData #-}
|
||||||
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
module Color where
|
module Color where
|
||||||
import GHC.Generics
|
import GHC.Generics
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Geometry
|
import Geometry
|
||||||
|
import LinearHelp
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data PaletteColor = RED | GREEN | BLUE | YELLOW | CYAN
|
data PaletteColor = RED | GREEN | BLUE | YELLOW | CYAN
|
||||||
| MAGENTA | ROSE | VIOLET | AZURE | AQUAMARINE | CHARTREUSE | ORANGE | WHITE | BLACK
|
| MAGENTA | ROSE | VIOLET | AZURE | AQUAMARINE | CHARTREUSE | ORANGE | WHITE | BLACK
|
||||||
@@ -134,3 +139,6 @@ numColor _ = toV4 (1,1,1,1)
|
|||||||
|
|
||||||
light4 :: Color -> Color
|
light4 :: Color -> Color
|
||||||
light4 = light . light . light . light
|
light4 = light . light . light . light
|
||||||
|
|
||||||
|
$($(derive [d| instance Deriving (Store PaletteColor) |]))
|
||||||
|
-- $($(derive [d| instance Deriving (Store ProximityRequirement) |]))
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import Dodge.Data.Creature.Stance
|
|||||||
import Dodge.Data.CreatureEffect
|
import Dodge.Data.CreatureEffect
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
import Sound.Data
|
import Sound.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data ActionPlan
|
data ActionPlan
|
||||||
= Inanimate
|
= Inanimate
|
||||||
@@ -200,3 +202,9 @@ deriveJSON defaultOptions ''Goal
|
|||||||
makeLenses ''ActionPlan
|
makeLenses ''ActionPlan
|
||||||
makeLenses ''Impulse
|
makeLenses ''Impulse
|
||||||
makeLenses ''Action
|
makeLenses ''Action
|
||||||
|
$($(derive [d| instance Deriving (Store ActionPlan) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store RandImpulse) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Impulse) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Action) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Strategy) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Goal) |]))
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ import Data.Aeson
|
|||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Dodge.Data.CrWlID
|
import Dodge.Data.CrWlID
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
import LinearHelp
|
||||||
|
|
||||||
data ArcStep = ArcStep
|
data ArcStep = ArcStep
|
||||||
{ _asPos :: Point2
|
{ _asPos :: Point2
|
||||||
@@ -24,3 +27,5 @@ data NextArcStep
|
|||||||
makeLenses ''ArcStep
|
makeLenses ''ArcStep
|
||||||
deriveJSON defaultOptions ''ArcStep
|
deriveJSON defaultOptions ''ArcStep
|
||||||
deriveJSON defaultOptions ''NextArcStep
|
deriveJSON defaultOptions ''NextArcStep
|
||||||
|
$($(derive [d| instance Deriving (Store ArcStep) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store NextArcStep) |]))
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import Control.Lens
|
|||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
{- | Linear beams. Last only one frame.
|
{- | Linear beams. Last only one frame.
|
||||||
- Can interact with one another in a limited manner
|
- Can interact with one another in a limited manner
|
||||||
@@ -54,3 +56,7 @@ deriveJSON defaultOptions ''BeamType
|
|||||||
deriveJSON defaultOptions ''Beam
|
deriveJSON defaultOptions ''Beam
|
||||||
deriveJSON defaultOptions ''BeamDraw
|
deriveJSON defaultOptions ''BeamDraw
|
||||||
deriveJSON defaultOptions ''BeamCombineType
|
deriveJSON defaultOptions ''BeamCombineType
|
||||||
|
$($(derive [d| instance Deriving (Store BeamType) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Beam) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store BeamDraw) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store BeamCombineType) |]))
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ module Dodge.Data.Block (
|
|||||||
module Dodge.Data.PathGraph,
|
module Dodge.Data.PathGraph,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -16,6 +17,8 @@ import Dodge.Data.Material
|
|||||||
import Dodge.Data.PathGraph
|
import Dodge.Data.PathGraph
|
||||||
import Geometry
|
import Geometry
|
||||||
import Shape.Data
|
import Shape.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data Block = Block
|
data Block = Block
|
||||||
{ _blID :: Int
|
{ _blID :: Int
|
||||||
@@ -48,3 +51,6 @@ makeLenses ''Block
|
|||||||
deriveJSON defaultOptions ''Block
|
deriveJSON defaultOptions ''Block
|
||||||
deriveJSON defaultOptions ''BlockDraw
|
deriveJSON defaultOptions ''BlockDraw
|
||||||
deriveJSON defaultOptions ''BlSh
|
deriveJSON defaultOptions ''BlSh
|
||||||
|
$($(derive [d| instance Deriving (Store Block) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store BlockDraw) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store BlSh) |]))
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ module Dodge.Data.Bounds where
|
|||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data Bounds = Bounds
|
data Bounds = Bounds
|
||||||
{ _bdMinX :: Float
|
{ _bdMinX :: Float
|
||||||
@@ -20,3 +22,4 @@ defaultBounds = Bounds 0 0 0 0
|
|||||||
|
|
||||||
makeLenses ''Bounds
|
makeLenses ''Bounds
|
||||||
deriveJSON defaultOptions ''Bounds
|
deriveJSON defaultOptions ''Bounds
|
||||||
|
$($(derive [d| instance Deriving (Store Bounds) |]))
|
||||||
|
|||||||
@@ -6,11 +6,14 @@ module Dodge.Data.Bullet
|
|||||||
, module Dodge.Data.Damage
|
, module Dodge.Data.Damage
|
||||||
)where
|
)where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Dodge.Data.Damage
|
import Dodge.Data.Damage
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data Bullet = Bullet
|
data Bullet = Bullet
|
||||||
{ _buDelayFraction :: Float
|
{ _buDelayFraction :: Float
|
||||||
@@ -32,6 +35,7 @@ data EnergyBallType = IncBall | TeslaBall | ConcBall
|
|||||||
deriving (Show, Read, Eq, Ord, Enum, Bounded)
|
deriving (Show, Read, Eq, Ord, Enum, Bounded)
|
||||||
|
|
||||||
data BulletUpdateMod = NoBulletUpdateMod
|
data BulletUpdateMod = NoBulletUpdateMod
|
||||||
|
| ABulletUpdateMod -- hack for template splicing
|
||||||
deriving (Show, Read, Eq, Ord, Enum, Bounded)
|
deriving (Show, Read, Eq, Ord, Enum, Bounded)
|
||||||
|
|
||||||
data BulletEffect
|
data BulletEffect
|
||||||
@@ -57,3 +61,9 @@ deriveJSON defaultOptions ''BulletUpdateMod
|
|||||||
deriveJSON defaultOptions ''BulletEffect
|
deriveJSON defaultOptions ''BulletEffect
|
||||||
deriveJSON defaultOptions ''BulletSpawn
|
deriveJSON defaultOptions ''BulletSpawn
|
||||||
deriveJSON defaultOptions ''BulletTrajectory
|
deriveJSON defaultOptions ''BulletTrajectory
|
||||||
|
$($(derive [d| instance Deriving (Store Bullet) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store EnergyBallType) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store BulletUpdateMod) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store BulletEffect) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store BulletSpawn) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store BulletTrajectory) |]))
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Button where
|
module Dodge.Data.Button where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -10,6 +11,8 @@ import Data.Aeson.TH
|
|||||||
import Dodge.Data.WorldEffect
|
import Dodge.Data.WorldEffect
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
import Sound.Data
|
import Sound.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data ButtonDraw
|
data ButtonDraw
|
||||||
= DefaultDrawButton Color
|
= DefaultDrawButton Color
|
||||||
@@ -65,3 +68,7 @@ deriveJSON defaultOptions ''ButtonDraw
|
|||||||
deriveJSON defaultOptions ''ButtonEvent
|
deriveJSON defaultOptions ''ButtonEvent
|
||||||
deriveJSON defaultOptions ''Button
|
deriveJSON defaultOptions ''Button
|
||||||
deriveJSON defaultOptions ''ButtonState
|
deriveJSON defaultOptions ''ButtonState
|
||||||
|
$($(derive [d| instance Deriving (Store ButtonDraw) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store ButtonEvent) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Button) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store ButtonState) |]))
|
||||||
|
|||||||
@@ -221,6 +221,9 @@ makeLenses ''WorldBeams
|
|||||||
makeLenses ''CWCam
|
makeLenses ''CWCam
|
||||||
makeLenses ''CWGen
|
makeLenses ''CWGen
|
||||||
makeLenses ''CWTime
|
makeLenses ''CWTime
|
||||||
$($(derive [d|
|
|
||||||
instance Deriving (Store CWorld)
|
$($(derive [d| instance Deriving (Store CWorld) |]))
|
||||||
|]))
|
$($(derive [d| instance Deriving (Store WorldBeams) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store CWCam) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store CWGen) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store CWTime) |]))
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ module Dodge.Data.CamouflageStatus where
|
|||||||
|
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data CamouflageStatus
|
data CamouflageStatus
|
||||||
= FullyVisible
|
= FullyVisible
|
||||||
@@ -12,3 +14,4 @@ data CamouflageStatus
|
|||||||
deriving (Eq, Ord, Enum, Read, Show, Bounded)
|
deriving (Eq, Ord, Enum, Read, Show, Bounded)
|
||||||
|
|
||||||
deriveJSON defaultOptions ''CamouflageStatus
|
deriveJSON defaultOptions ''CamouflageStatus
|
||||||
|
$($(derive [d| instance Deriving (Store CamouflageStatus) |]))
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import Control.Lens
|
|||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Geometry
|
import Geometry
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data CloudDraw
|
data CloudDraw
|
||||||
= CloudColor Float Float Color -- radius-multiply fade-time color
|
= CloudColor Float Float Color -- radius-multiply fade-time color
|
||||||
@@ -34,3 +36,6 @@ makeLenses ''Cloud
|
|||||||
deriveJSON defaultOptions ''CloudDraw
|
deriveJSON defaultOptions ''CloudDraw
|
||||||
deriveJSON defaultOptions ''Cloud
|
deriveJSON defaultOptions ''Cloud
|
||||||
deriveJSON defaultOptions ''CloudType
|
deriveJSON defaultOptions ''CloudType
|
||||||
|
$($(derive [d| instance Deriving (Store CloudDraw) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Cloud) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store CloudType) |]))
|
||||||
|
|||||||
@@ -3,13 +3,17 @@
|
|||||||
|
|
||||||
module Dodge.Data.Corpse where
|
module Dodge.Data.Corpse where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
import ShapePicture.Data
|
import ShapePicture.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data CorpseResurrection = NoResurrection
|
data CorpseResurrection = NoResurrection
|
||||||
|
| HackCorpseRez
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
data Corpse = Corpse
|
data Corpse = Corpse
|
||||||
@@ -24,3 +28,5 @@ data Corpse = Corpse
|
|||||||
makeLenses ''Corpse
|
makeLenses ''Corpse
|
||||||
deriveJSON defaultOptions ''CorpseResurrection
|
deriveJSON defaultOptions ''CorpseResurrection
|
||||||
deriveJSON defaultOptions ''Corpse
|
deriveJSON defaultOptions ''Corpse
|
||||||
|
$($(derive [d| instance Deriving (Store CorpseResurrection) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Corpse) |]))
|
||||||
|
|||||||
@@ -3,11 +3,14 @@
|
|||||||
|
|
||||||
module Dodge.Data.CrGroupParams where
|
module Dodge.Data.CrGroupParams where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import qualified Data.IntSet as IS
|
import qualified Data.IntSet as IS
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data CrGroupParams = CrGroupParams
|
data CrGroupParams = CrGroupParams
|
||||||
{ _crGroupParamID :: Int
|
{ _crGroupParamID :: Int
|
||||||
@@ -18,8 +21,11 @@ data CrGroupParams = CrGroupParams
|
|||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
data CrGroupUpdate = DefaultCrGroupUpdate
|
data CrGroupUpdate = DefaultCrGroupUpdate
|
||||||
|
| HackCrGroupUpdate
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
makeLenses ''CrGroupParams
|
makeLenses ''CrGroupParams
|
||||||
deriveJSON defaultOptions ''CrGroupParams
|
deriveJSON defaultOptions ''CrGroupParams
|
||||||
deriveJSON defaultOptions ''CrGroupUpdate
|
deriveJSON defaultOptions ''CrGroupUpdate
|
||||||
|
$($(derive [d| instance Deriving (Store CrGroupParams) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store CrGroupUpdate) |]))
|
||||||
|
|||||||
@@ -6,9 +6,12 @@ module Dodge.Data.CrWlID where
|
|||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data CrWlID = CrID Int | WlID Int | NothingID -- TODO rewrite/remove this
|
data CrWlID = CrID Int | WlID Int | NothingID -- TODO rewrite/remove this
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
makeLenses ''CrWlID
|
makeLenses ''CrWlID
|
||||||
deriveJSON defaultOptions ''CrWlID
|
deriveJSON defaultOptions ''CrWlID
|
||||||
|
$($(derive [d| instance Deriving (Store CrWlID) |]))
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{-# LANGUAGE StrictData #-}
|
{-# LANGUAGE StrictData #-}
|
||||||
{-# LANGUAGE TemplateHaskell #-}
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
|
|
||||||
module Dodge.Data.Creature (
|
module Dodge.Data.Creature (
|
||||||
module Dodge.Data.Creature,
|
module Dodge.Data.Creature,
|
||||||
@@ -14,6 +15,9 @@ module Dodge.Data.Creature (
|
|||||||
module Dodge.Data.Hammer,
|
module Dodge.Data.Hammer,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
@@ -73,6 +77,7 @@ data Creature = Creature
|
|||||||
deriving (Eq, Show, Read)
|
deriving (Eq, Show, Read)
|
||||||
|
|
||||||
data CreatureCorpse = MakeDefaultCorpse
|
data CreatureCorpse = MakeDefaultCorpse
|
||||||
|
| HackDefaultCorpse
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
data Intention = Intention
|
data Intention = Intention
|
||||||
@@ -90,3 +95,15 @@ makeLenses ''Intention
|
|||||||
deriveJSON defaultOptions ''Creature
|
deriveJSON defaultOptions ''Creature
|
||||||
deriveJSON defaultOptions ''CreatureCorpse
|
deriveJSON defaultOptions ''CreatureCorpse
|
||||||
deriveJSON defaultOptions ''Intention
|
deriveJSON defaultOptions ''Intention
|
||||||
|
|
||||||
|
{- FOURMOLU_DISABLE -}
|
||||||
|
$($(derive [d|
|
||||||
|
instance Deriving (Store Intention)
|
||||||
|
|]))
|
||||||
|
$($(derive [d|
|
||||||
|
instance Deriving (Store CreatureCorpse)
|
||||||
|
|]))
|
||||||
|
$($(derive [d|
|
||||||
|
instance Deriving (Store Creature)
|
||||||
|
|]))
|
||||||
|
{- FOURMOLU_ENABLE -}
|
||||||
|
|||||||
@@ -3,10 +3,13 @@
|
|||||||
|
|
||||||
module Dodge.Data.Creature.Memory where
|
module Dodge.Data.Creature.Memory where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data Memory = Memory
|
data Memory = Memory
|
||||||
{ _soundsToInvestigate :: [Point2]
|
{ _soundsToInvestigate :: [Point2]
|
||||||
@@ -16,3 +19,4 @@ data Memory = Memory
|
|||||||
|
|
||||||
makeLenses ''Memory
|
makeLenses ''Memory
|
||||||
deriveJSON defaultOptions ''Memory
|
deriveJSON defaultOptions ''Memory
|
||||||
|
$($(derive [d| instance Deriving (Store Memory) |]))
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ module Dodge.Data.Creature.Misc (
|
|||||||
module Dodge.Data.CamouflageStatus,
|
module Dodge.Data.CamouflageStatus,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -84,3 +86,12 @@ deriveJSON defaultOptions ''CrMvType
|
|||||||
deriveJSON defaultOptions ''HumanoidAI
|
deriveJSON defaultOptions ''HumanoidAI
|
||||||
deriveJSON defaultOptions ''CreatureType
|
deriveJSON defaultOptions ''CreatureType
|
||||||
deriveJSON defaultOptions ''BarrelType
|
deriveJSON defaultOptions ''BarrelType
|
||||||
|
|
||||||
|
{- FOURMOLU_DISABLE -}
|
||||||
|
$($(derive [d| instance Deriving (Store CreatureStatistics) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Vocalization) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store CrMvType) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store HumanoidAI) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store CreatureType) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store BarrelType) |]))
|
||||||
|
{- FOURMOLU_ENABLE -}
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ import Data.Aeson
|
|||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Dodge.Data.FloatFunction
|
import Dodge.Data.FloatFunction
|
||||||
import qualified IntMapHelp as IM
|
import qualified IntMapHelp as IM
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data Perception = Perception
|
data Perception = Perception
|
||||||
{ _cpVigilance :: Vigilance
|
{ _cpVigilance :: Vigilance
|
||||||
@@ -75,3 +77,9 @@ deriveJSON defaultOptions ''Audition
|
|||||||
deriveJSON defaultOptions ''Vigilance
|
deriveJSON defaultOptions ''Vigilance
|
||||||
deriveJSON defaultOptions ''Attention
|
deriveJSON defaultOptions ''Attention
|
||||||
deriveJSON defaultOptions ''Awareness
|
deriveJSON defaultOptions ''Awareness
|
||||||
|
$($(derive [d| instance Deriving (Store Perception) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Vision) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Audition) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Vigilance) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Attention) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Awareness) |]))
|
||||||
|
|||||||
@@ -3,10 +3,13 @@
|
|||||||
|
|
||||||
module Dodge.Data.Creature.Stance where
|
module Dodge.Data.Creature.Stance where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data Stance = Stance
|
data Stance = Stance
|
||||||
{ _carriage :: Carriage
|
{ _carriage :: Carriage
|
||||||
@@ -45,3 +48,7 @@ deriveJSON defaultOptions ''Stance
|
|||||||
deriveJSON defaultOptions ''Carriage
|
deriveJSON defaultOptions ''Carriage
|
||||||
deriveJSON defaultOptions ''FootForward
|
deriveJSON defaultOptions ''FootForward
|
||||||
deriveJSON defaultOptions ''Posture
|
deriveJSON defaultOptions ''Posture
|
||||||
|
$($(derive [d| instance Deriving (Store Stance) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Carriage) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store FootForward) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Posture) |]))
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import Data.Aeson.TH
|
|||||||
import qualified Data.IntSet as IS
|
import qualified Data.IntSet as IS
|
||||||
import Dodge.Data.Damage
|
import Dodge.Data.Damage
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data CreatureState = CrSt
|
data CreatureState = CrSt
|
||||||
{ _csDamage :: [Damage]
|
{ _csDamage :: [Damage]
|
||||||
@@ -58,3 +60,8 @@ deriveJSON defaultOptions ''CreatureDropType
|
|||||||
deriveJSON defaultOptions ''CrSpState
|
deriveJSON defaultOptions ''CrSpState
|
||||||
deriveJSON defaultOptions ''Faction
|
deriveJSON defaultOptions ''Faction
|
||||||
deriveJSON defaultOptions ''CrGroup
|
deriveJSON defaultOptions ''CrGroup
|
||||||
|
$($(derive [d| instance Deriving (Store CreatureState) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store CreatureDropType) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store CrSpState) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Faction) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store CrGroup) |]))
|
||||||
|
|||||||
@@ -5,17 +5,23 @@ module Dodge.Data.CreatureEffect where
|
|||||||
|
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data WdCrCr = NoCreatureEffect
|
data WdCrCr = NoCreatureEffect
|
||||||
|
| HackWdCrCr
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
data CrWdImp = NoCrWdImp
|
data CrWdImp = NoCrWdImp
|
||||||
|
| HackCrWdImp
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
data CrWdWd = CrWdWdId
|
data CrWdWd = CrWdWdId
|
||||||
|
| HackCrWdWd
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
data IntImp = NoIntImp
|
data IntImp = NoIntImp
|
||||||
|
| HackIntImp
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
data CrImp
|
data CrImp
|
||||||
@@ -24,6 +30,7 @@ data CrImp
|
|||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
data P2Imp = P2ImpNo
|
data P2Imp = P2ImpNo
|
||||||
|
| HackP2Imp
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
data WdCrBl
|
data WdCrBl
|
||||||
@@ -42,6 +49,7 @@ data CrBl
|
|||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
data MCrAc = MCrNoAction
|
data MCrAc = MCrNoAction
|
||||||
|
| HackMCrAc
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
data CrAc
|
data CrAc
|
||||||
@@ -50,9 +58,11 @@ data CrAc
|
|||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
data P2Ac = P2NoAction
|
data P2Ac = P2NoAction
|
||||||
|
| HackP2Ac
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
data MP2Ac = MP2NoAction
|
data MP2Ac = MP2NoAction
|
||||||
|
| HackMP2Ac
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
data CrWdAc
|
data CrWdAc
|
||||||
@@ -74,3 +84,16 @@ deriveJSON defaultOptions ''CrAc
|
|||||||
deriveJSON defaultOptions ''P2Ac
|
deriveJSON defaultOptions ''P2Ac
|
||||||
deriveJSON defaultOptions ''MP2Ac
|
deriveJSON defaultOptions ''MP2Ac
|
||||||
deriveJSON defaultOptions ''CrWdAc
|
deriveJSON defaultOptions ''CrWdAc
|
||||||
|
$($(derive [d| instance Deriving (Store WdCrCr) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store CrWdImp) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store CrWdWd) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store IntImp) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store CrImp) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store P2Imp) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store WdCrBl) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store CrBl) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store MCrAc) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store CrAc) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store P2Ac) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store MP2Ac) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store CrWdAc) |]))
|
||||||
|
|||||||
@@ -10,7 +10,10 @@ module Dodge.Data.Damage (
|
|||||||
module Dodge.Data.Damage.Type,
|
module Dodge.Data.Damage.Type,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Dodge.Data.Damage.Type
|
import Dodge.Data.Damage.Type
|
||||||
@@ -52,3 +55,5 @@ makeLenses ''Damage
|
|||||||
makeLenses ''DamageEffect
|
makeLenses ''DamageEffect
|
||||||
deriveJSON defaultOptions ''DamageEffect
|
deriveJSON defaultOptions ''DamageEffect
|
||||||
deriveJSON defaultOptions ''Damage
|
deriveJSON defaultOptions ''Damage
|
||||||
|
$($(derive [d| instance Deriving (Store DamageEffect) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Damage) |]))
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ module Dodge.Data.Damage.Type where
|
|||||||
|
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data DamageType
|
data DamageType
|
||||||
= PIERCING
|
= PIERCING
|
||||||
@@ -29,3 +31,4 @@ instance ToJSONKey DamageType
|
|||||||
instance FromJSONKey DamageType
|
instance FromJSONKey DamageType
|
||||||
|
|
||||||
deriveJSON defaultOptions ''DamageType
|
deriveJSON defaultOptions ''DamageType
|
||||||
|
$($(derive [d| instance Deriving (Store DamageType) |]))
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
{-# LANGUAGE TemplateHaskell #-}
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
{-# LANGUAGE StrictData #-}
|
{-# LANGUAGE StrictData #-}
|
||||||
module Dodge.Data.Distortion where
|
module Dodge.Data.Distortion where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Geometry
|
import Geometry
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data Distortion
|
data Distortion
|
||||||
= RadialDistortion Point2 Point2 Point2 Float
|
= RadialDistortion Point2 Point2 Point2 Float
|
||||||
deriving (Eq,Ord,Show,Read)
|
deriving (Eq,Ord,Show,Read)
|
||||||
|
|
||||||
deriveJSON defaultOptions ''Distortion
|
deriveJSON defaultOptions ''Distortion
|
||||||
|
$($(derive [d| instance Deriving (Store Distortion) |]))
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ module Dodge.Data.Door (
|
|||||||
module Dodge.Data.WorldEffect,
|
module Dodge.Data.WorldEffect,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
@@ -16,6 +17,8 @@ import Dodge.Data.MountedObject
|
|||||||
import Dodge.Data.PathGraph
|
import Dodge.Data.PathGraph
|
||||||
import Dodge.Data.WorldEffect
|
import Dodge.Data.WorldEffect
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data DoorStatus = DoorOpen | DoorClosed | DoorHalfway | DoorInt Int
|
data DoorStatus = DoorOpen | DoorClosed | DoorHalfway | DoorInt Int
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
@@ -50,3 +53,6 @@ makeLenses ''Door
|
|||||||
deriveJSON defaultOptions ''DoorStatus
|
deriveJSON defaultOptions ''DoorStatus
|
||||||
deriveJSON defaultOptions ''PushSource
|
deriveJSON defaultOptions ''PushSource
|
||||||
deriveJSON defaultOptions ''Door
|
deriveJSON defaultOptions ''Door
|
||||||
|
$($(derive [d| instance Deriving (Store DoorStatus) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store PushSource) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Door) |]))
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import Data.Aeson
|
|||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Dodge.Data.Damage.Type
|
import Dodge.Data.Damage.Type
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data EnergyBall = EnergyBall
|
data EnergyBall = EnergyBall
|
||||||
{ _ebVel :: Point2
|
{ _ebVel :: Point2
|
||||||
@@ -24,3 +26,4 @@ data EnergyBall = EnergyBall
|
|||||||
|
|
||||||
makeLenses ''EnergyBall
|
makeLenses ''EnergyBall
|
||||||
deriveJSON defaultOptions ''EnergyBall
|
deriveJSON defaultOptions ''EnergyBall
|
||||||
|
$($(derive [d| instance Deriving (Store EnergyBall) |]))
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ module Dodge.Data.Equipment.Misc where
|
|||||||
|
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data EquipSite
|
data EquipSite
|
||||||
= GoesOnHead
|
= GoesOnHead
|
||||||
@@ -31,3 +33,5 @@ instance FromJSONKey EquipPosition
|
|||||||
|
|
||||||
deriveJSON defaultOptions ''EquipSite
|
deriveJSON defaultOptions ''EquipSite
|
||||||
deriveJSON defaultOptions ''EquipPosition
|
deriveJSON defaultOptions ''EquipPosition
|
||||||
|
$($(derive [d| instance Deriving (Store EquipSite) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store EquipPosition) |]))
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import Control.Lens
|
|||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data Flame = Flame
|
data Flame = Flame
|
||||||
{ _flVel :: Point2
|
{ _flVel :: Point2
|
||||||
@@ -22,3 +24,4 @@ data Flame = Flame
|
|||||||
|
|
||||||
makeLenses ''Flame
|
makeLenses ''Flame
|
||||||
deriveJSON defaultOptions ''Flame
|
deriveJSON defaultOptions ''Flame
|
||||||
|
$($(derive [d| instance Deriving (Store Flame) |]))
|
||||||
|
|||||||
@@ -3,11 +3,14 @@
|
|||||||
|
|
||||||
module Dodge.Data.Flare where
|
module Dodge.Data.Flare where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Geometry
|
import Geometry
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data Flare
|
data Flare
|
||||||
= MuzFlare
|
= MuzFlare
|
||||||
@@ -26,3 +29,4 @@ data Flare
|
|||||||
|
|
||||||
makeLenses ''Flare
|
makeLenses ''Flare
|
||||||
deriveJSON defaultOptions ''Flare
|
deriveJSON defaultOptions ''Flare
|
||||||
|
$($(derive [d| instance Deriving (Store Flare) |]))
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
module Dodge.Data.FloatFunction where
|
module Dodge.Data.FloatFunction where
|
||||||
|
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
|
|
||||||
@@ -15,3 +17,5 @@ data FloatFloat
|
|||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
deriveJSON defaultOptions ''FloatFloat
|
deriveJSON defaultOptions ''FloatFloat
|
||||||
|
|
||||||
|
$($(derive [d|instance Deriving (Store FloatFloat)|]))
|
||||||
|
|||||||
@@ -3,14 +3,18 @@
|
|||||||
|
|
||||||
module Dodge.Data.FloorItem where
|
module Dodge.Data.FloorItem where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Dodge.Data.Item
|
import Dodge.Data.Item
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data FloorItem = FlIt {_flIt :: Item, _flItPos :: Point2, _flItRot :: Float, _flItID :: Int}
|
data FloorItem = FlIt {_flIt :: Item, _flItPos :: Point2, _flItRot :: Float, _flItID :: Int}
|
||||||
deriving (Eq, Show, Read)
|
deriving (Eq, Show, Read)
|
||||||
|
|
||||||
makeLenses ''FloorItem
|
makeLenses ''FloorItem
|
||||||
deriveJSON defaultOptions ''FloorItem
|
deriveJSON defaultOptions ''FloorItem
|
||||||
|
$($(derive [d| instance Deriving (Store FloorItem) |]))
|
||||||
|
|||||||
@@ -3,11 +3,14 @@
|
|||||||
|
|
||||||
module Dodge.Data.ForegroundShape where
|
module Dodge.Data.ForegroundShape where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Geometry
|
import Geometry
|
||||||
import ShapePicture
|
import ShapePicture
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data ForegroundShape = ForegroundShape
|
data ForegroundShape = ForegroundShape
|
||||||
{ _fsID :: Int
|
{ _fsID :: Int
|
||||||
@@ -20,3 +23,4 @@ data ForegroundShape = ForegroundShape
|
|||||||
|
|
||||||
makeLenses ''ForegroundShape
|
makeLenses ''ForegroundShape
|
||||||
deriveJSON defaultOptions ''ForegroundShape
|
deriveJSON defaultOptions ''ForegroundShape
|
||||||
|
$($(derive [d| instance Deriving (Store ForegroundShape) |]))
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import Data.Aeson
|
|||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import qualified Data.Map.Strict as M
|
import qualified Data.Map.Strict as M
|
||||||
import Dodge.Data.Damage.Type
|
import Dodge.Data.Damage.Type
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
newtype GenParams = GenParams
|
newtype GenParams = GenParams
|
||||||
{ _sensorCoding :: M.Map DamageType (PaletteColor, DecorationShape)
|
{ _sensorCoding :: M.Map DamageType (PaletteColor, DecorationShape)
|
||||||
@@ -21,3 +23,5 @@ data DecorationShape = PLUS | SQUARE | CIRCLE | THREELINES
|
|||||||
makeLenses ''GenParams
|
makeLenses ''GenParams
|
||||||
deriveJSON defaultOptions ''GenParams
|
deriveJSON defaultOptions ''GenParams
|
||||||
deriveJSON defaultOptions ''DecorationShape
|
deriveJSON defaultOptions ''DecorationShape
|
||||||
|
$($(derive [d| instance Deriving (Store GenParams) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store DecorationShape) |]))
|
||||||
|
|||||||
@@ -3,10 +3,13 @@
|
|||||||
|
|
||||||
module Dodge.Data.Gust where
|
module Dodge.Data.Gust where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data Gust = Gust
|
data Gust = Gust
|
||||||
{ _guID :: Int
|
{ _guID :: Int
|
||||||
@@ -18,3 +21,4 @@ data Gust = Gust
|
|||||||
|
|
||||||
makeLenses ''Gust
|
makeLenses ''Gust
|
||||||
deriveJSON defaultOptions ''Gust
|
deriveJSON defaultOptions ''Gust
|
||||||
|
$($(derive [d| instance Deriving (Store Gust) |]))
|
||||||
|
|||||||
@@ -3,10 +3,13 @@
|
|||||||
|
|
||||||
module Dodge.Data.HUD where
|
module Dodge.Data.HUD where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data HUDElement
|
data HUDElement
|
||||||
= DisplayInventory {_subInventory :: SubInventory}
|
= DisplayInventory {_subInventory :: SubInventory}
|
||||||
@@ -36,3 +39,6 @@ makeLenses ''SubInventory
|
|||||||
deriveJSON defaultOptions ''HUDElement
|
deriveJSON defaultOptions ''HUDElement
|
||||||
deriveJSON defaultOptions ''SubInventory
|
deriveJSON defaultOptions ''SubInventory
|
||||||
deriveJSON defaultOptions ''HUD
|
deriveJSON defaultOptions ''HUD
|
||||||
|
$($(derive [d| instance Deriving (Store HUDElement) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store SubInventory) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store HUD) |]))
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ module Dodge.Data.Hammer where
|
|||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data HammerType
|
data HammerType
|
||||||
= NoHammer
|
= NoHammer
|
||||||
@@ -21,3 +23,5 @@ data HammerPosition
|
|||||||
makeLenses ''HammerType
|
makeLenses ''HammerType
|
||||||
deriveJSON defaultOptions ''HammerType
|
deriveJSON defaultOptions ''HammerType
|
||||||
deriveJSON defaultOptions ''HammerPosition
|
deriveJSON defaultOptions ''HammerPosition
|
||||||
|
$($(derive [d| instance Deriving (Store HammerType) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store HammerPosition) |]))
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ module Dodge.Data.Item (
|
|||||||
module Dodge.Data.Item.Location,
|
module Dodge.Data.Item.Location,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Data.Store
|
||||||
|
import TH.Derive
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -54,3 +56,5 @@ _itUseAimStance = _aimStance . _heldAim . _itUse
|
|||||||
|
|
||||||
makeLenses ''Item
|
makeLenses ''Item
|
||||||
deriveJSON defaultOptions ''Item
|
deriveJSON defaultOptions ''Item
|
||||||
|
|
||||||
|
$($(derive [d| instance Deriving (Store Item) |]))
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
module Dodge.Data.Item.Combine where
|
module Dodge.Data.Item.Combine where
|
||||||
|
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import qualified Data.Map.Strict as M
|
import qualified Data.Map.Strict as M
|
||||||
@@ -219,3 +221,14 @@ deriveJSON defaultOptions ''ModuleSlot
|
|||||||
makeLenses ''ItemType
|
makeLenses ''ItemType
|
||||||
makeLenses ''ItemBaseType
|
makeLenses ''ItemBaseType
|
||||||
makeLenses ''HeldItemType
|
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
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data CurseStatus
|
data CurseStatus
|
||||||
= Uncursed
|
= Uncursed
|
||||||
@@ -13,3 +15,4 @@ data CurseStatus
|
|||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
deriveJSON defaultOptions ''CurseStatus
|
deriveJSON defaultOptions ''CurseStatus
|
||||||
|
$($(derive [d| instance Deriving (Store CurseStatus) |]))
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ module Dodge.Data.Item.Effect where
|
|||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data ItEffect = ItEffect
|
data ItEffect = ItEffect
|
||||||
{ _ieInv :: ItInvEffect --Item -> Creature -> World -> World
|
{ _ieInv :: ItInvEffect --Item -> Creature -> World -> World
|
||||||
@@ -27,9 +29,11 @@ data ItInvEffect
|
|||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
data ItFloorEffect = NoFloorEffect
|
data ItFloorEffect = NoFloorEffect
|
||||||
|
| DefaultFloorEffect
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
data ItDropEffect = NoDropEffect
|
data ItDropEffect = NoDropEffect
|
||||||
|
| DefaultDropEffect
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
makeLenses ''ItEffect
|
makeLenses ''ItEffect
|
||||||
@@ -37,3 +41,7 @@ deriveJSON defaultOptions ''ItEffect
|
|||||||
deriveJSON defaultOptions ''ItInvEffect
|
deriveJSON defaultOptions ''ItInvEffect
|
||||||
deriveJSON defaultOptions ''ItFloorEffect
|
deriveJSON defaultOptions ''ItFloorEffect
|
||||||
deriveJSON defaultOptions ''ItDropEffect
|
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 Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data UseDelay -- should just be Delay
|
data UseDelay -- should just be Delay
|
||||||
= NoDelay
|
= NoDelay
|
||||||
@@ -27,3 +29,4 @@ data UseDelay -- should just be Delay
|
|||||||
|
|
||||||
makeLenses ''UseDelay
|
makeLenses ''UseDelay
|
||||||
deriveJSON defaultOptions ''UseDelay
|
deriveJSON defaultOptions ''UseDelay
|
||||||
|
$($(derive [d| instance Deriving (Store UseDelay) |]))
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import Control.Lens
|
|||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import qualified Data.Sequence as Seq
|
import qualified Data.Sequence as Seq
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data HeldScroll
|
data HeldScroll
|
||||||
= HeldScrollDoNothing
|
= HeldScrollDoNothing
|
||||||
@@ -21,3 +23,4 @@ data HeldScroll
|
|||||||
|
|
||||||
makeLenses ''HeldScroll
|
makeLenses ''HeldScroll
|
||||||
deriveJSON defaultOptions ''HeldScroll
|
deriveJSON defaultOptions ''HeldScroll
|
||||||
|
$($(derive [d| instance Deriving (Store HeldScroll) |]))
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import Data.Aeson
|
|||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Dodge.Data.CamouflageStatus
|
import Dodge.Data.CamouflageStatus
|
||||||
import Dodge.Data.Item.Combine
|
import Dodge.Data.Item.Combine
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data HeldUse
|
data HeldUse
|
||||||
= HeldDoNothing
|
= HeldDoNothing
|
||||||
@@ -94,3 +96,8 @@ deriveJSON defaultOptions ''HeldMod
|
|||||||
deriveJSON defaultOptions ''Euse
|
deriveJSON defaultOptions ''Euse
|
||||||
deriveJSON defaultOptions ''HeldUse
|
deriveJSON defaultOptions ''HeldUse
|
||||||
deriveJSON defaultOptions ''Luse
|
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 Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data ItemLocation
|
data ItemLocation
|
||||||
= InInv {_ipCrID :: Int, _ipInvID :: Int}
|
= InInv {_ipCrID :: Int, _ipInvID :: Int}
|
||||||
@@ -15,3 +17,4 @@ data ItemLocation
|
|||||||
|
|
||||||
makeLenses ''ItemLocation
|
makeLenses ''ItemLocation
|
||||||
deriveJSON defaultOptions ''ItemLocation
|
deriveJSON defaultOptions ''ItemLocation
|
||||||
|
$($(derive [d| instance Deriving (Store ItemLocation) |]))
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ import Control.Lens
|
|||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
import LinearHelp
|
||||||
|
|
||||||
data ItemDimension = ItemDimension
|
data ItemDimension = ItemDimension
|
||||||
{ _dimRad :: Float
|
{ _dimRad :: Float
|
||||||
@@ -40,3 +43,7 @@ deriveJSON defaultOptions ''ItemDimension
|
|||||||
deriveJSON defaultOptions ''ItemPortage
|
deriveJSON defaultOptions ''ItemPortage
|
||||||
deriveJSON defaultOptions ''ItemValue
|
deriveJSON defaultOptions ''ItemValue
|
||||||
deriveJSON defaultOptions ''ItemValueType
|
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.ArcStep
|
||||||
import Dodge.Data.Beam
|
import Dodge.Data.Beam
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data ItemParams
|
data ItemParams
|
||||||
= NoParams
|
= NoParams
|
||||||
@@ -113,3 +115,9 @@ deriveJSON defaultOptions ''PreviousArcEffect
|
|||||||
deriveJSON defaultOptions ''GunBarrels
|
deriveJSON defaultOptions ''GunBarrels
|
||||||
deriveJSON defaultOptions ''Nozzle
|
deriveJSON defaultOptions ''Nozzle
|
||||||
deriveJSON defaultOptions ''BarrelSpread
|
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
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
import LinearHelp
|
||||||
|
|
||||||
data Scope
|
data Scope
|
||||||
= NoScope
|
= NoScope
|
||||||
@@ -30,3 +33,4 @@ data Scope
|
|||||||
|
|
||||||
makeLenses ''Scope
|
makeLenses ''Scope
|
||||||
deriveJSON defaultOptions ''Scope
|
deriveJSON defaultOptions ''Scope
|
||||||
|
$($(derive [d| instance Deriving (Store Scope) |]))
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ import Control.Lens
|
|||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
import LinearHelp
|
||||||
|
|
||||||
data Targeting
|
data Targeting
|
||||||
= NoTargeting
|
= NoTargeting
|
||||||
@@ -38,3 +41,6 @@ makeLenses ''Targeting
|
|||||||
deriveJSON defaultOptions ''Targeting
|
deriveJSON defaultOptions ''Targeting
|
||||||
deriveJSON defaultOptions ''TargetUpdate
|
deriveJSON defaultOptions ''TargetUpdate
|
||||||
deriveJSON defaultOptions ''TargetDraw
|
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
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import qualified IntMapHelp as IM
|
import qualified IntMapHelp as IM
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data ItemTweaks
|
data ItemTweaks
|
||||||
= NoTweaks
|
= NoTweaks
|
||||||
@@ -35,3 +37,6 @@ makeLenses ''ItemTweaks
|
|||||||
deriveJSON defaultOptions ''ItemTweaks
|
deriveJSON defaultOptions ''ItemTweaks
|
||||||
deriveJSON defaultOptions ''TweakType
|
deriveJSON defaultOptions ''TweakType
|
||||||
deriveJSON defaultOptions ''TweakParam
|
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.Consumption
|
||||||
import Dodge.Data.Item.Use.Equipment
|
import Dodge.Data.Item.Use.Equipment
|
||||||
import Dodge.Data.Item.HeldDelay
|
import Dodge.Data.Item.HeldDelay
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data ItemUse
|
data ItemUse
|
||||||
= HeldUse
|
= HeldUse
|
||||||
@@ -80,3 +82,8 @@ deriveJSON defaultOptions ''ItemUse
|
|||||||
deriveJSON defaultOptions ''AimParams
|
deriveJSON defaultOptions ''AimParams
|
||||||
deriveJSON defaultOptions ''AimStance
|
deriveJSON defaultOptions ''AimStance
|
||||||
deriveJSON defaultOptions ''ItZoom
|
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,
|
module Dodge.Data.Item.Use.Consumption.LoadAction,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
@@ -48,3 +50,6 @@ makeLenses ''ItAmount
|
|||||||
deriveJSON defaultOptions ''HeldConsumption
|
deriveJSON defaultOptions ''HeldConsumption
|
||||||
deriveJSON defaultOptions ''LeftConsumption
|
deriveJSON defaultOptions ''LeftConsumption
|
||||||
deriveJSON defaultOptions ''ItAmount
|
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,
|
module Dodge.Data.Payload,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
@@ -56,6 +58,7 @@ data AmmoType
|
|||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
data ForceFieldType = DefaultForceField
|
data ForceFieldType = DefaultForceField
|
||||||
|
| HackForTemplateForceField
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
data GasCreate = CreatePoisonGas | CreateFlame
|
data GasCreate = CreatePoisonGas | CreateFlame
|
||||||
@@ -69,3 +72,9 @@ deriveJSON defaultOptions ''ProjectileUpdate
|
|||||||
deriveJSON defaultOptions ''AmmoType
|
deriveJSON defaultOptions ''AmmoType
|
||||||
deriveJSON defaultOptions ''GasCreate
|
deriveJSON defaultOptions ''GasCreate
|
||||||
deriveJSON defaultOptions ''ForceFieldType
|
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 Data.Aeson.TH
|
||||||
import Dodge.Data.Hammer
|
import Dodge.Data.Hammer
|
||||||
import Sound.Data
|
import Sound.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data LoadAction
|
data LoadAction
|
||||||
= LoadEject {_actionTime :: Int, _actionSound :: SoundID}
|
= LoadEject {_actionTime :: Int, _actionSound :: SoundID}
|
||||||
@@ -30,3 +32,6 @@ makeLenses ''InvSelAction
|
|||||||
deriveJSON defaultOptions ''LoadAction
|
deriveJSON defaultOptions ''LoadAction
|
||||||
deriveJSON defaultOptions ''InvSel
|
deriveJSON defaultOptions ''InvSel
|
||||||
deriveJSON defaultOptions ''InvSelAction
|
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 Data.Aeson.TH
|
||||||
import Dodge.Data.Equipment.Misc
|
import Dodge.Data.Equipment.Misc
|
||||||
import Dodge.Data.Item.HeldUse
|
import Dodge.Data.Item.HeldUse
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data EquipEffect = EquipEffect
|
data EquipEffect = EquipEffect
|
||||||
{ _eeUse :: Euse --Item -> Creature -> World -> World
|
{ _eeUse :: Euse --Item -> Creature -> World -> World
|
||||||
@@ -32,3 +34,5 @@ makeLenses ''EquipEffect
|
|||||||
makeLenses ''EquipParams
|
makeLenses ''EquipParams
|
||||||
deriveJSON defaultOptions ''EquipEffect
|
deriveJSON defaultOptions ''EquipEffect
|
||||||
deriveJSON defaultOptions ''EquipParams
|
deriveJSON defaultOptions ''EquipParams
|
||||||
|
$($(derive [d| instance Deriving (Store EquipEffect) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store EquipParams) |]))
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import Control.Lens
|
|||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data LaserType
|
data LaserType
|
||||||
= DamageLaser {_laserTypeDamage :: Int}
|
= DamageLaser {_laserTypeDamage :: Int}
|
||||||
@@ -36,3 +38,6 @@ makeLenses ''LaserType
|
|||||||
deriveJSON defaultOptions ''LaserType
|
deriveJSON defaultOptions ''LaserType
|
||||||
deriveJSON defaultOptions ''LaserStart
|
deriveJSON defaultOptions ''LaserStart
|
||||||
deriveJSON defaultOptions ''Laser
|
deriveJSON defaultOptions ''Laser
|
||||||
|
$($(derive [d| instance Deriving (Store LaserType) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store LaserStart) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Laser) |]))
|
||||||
|
|||||||
@@ -3,12 +3,16 @@
|
|||||||
|
|
||||||
module Dodge.Data.LightSource where
|
module Dodge.Data.LightSource where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Geometry
|
import Geometry
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data LightSourceDraw = DefaultLightSourceDraw
|
data LightSourceDraw = DefaultLightSourceDraw
|
||||||
|
| HackLightSourceDraw
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
data TLSIntensity
|
data TLSIntensity
|
||||||
@@ -53,3 +57,9 @@ deriveJSON defaultOptions ''TLSUpdate
|
|||||||
deriveJSON defaultOptions ''LSParam
|
deriveJSON defaultOptions ''LSParam
|
||||||
deriveJSON defaultOptions ''LightSource
|
deriveJSON defaultOptions ''LightSource
|
||||||
deriveJSON defaultOptions ''TempLightSource
|
deriveJSON defaultOptions ''TempLightSource
|
||||||
|
$($(derive [d| instance Deriving (Store LightSourceDraw) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store TLSIntensity) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store TLSUpdate) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store LSParam) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store LightSource) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store TempLightSource) |]))
|
||||||
|
|||||||
@@ -3,10 +3,13 @@
|
|||||||
|
|
||||||
module Dodge.Data.LinearShockwave where
|
module Dodge.Data.LinearShockwave where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data LinearShockwave = LinearShockwave
|
data LinearShockwave = LinearShockwave
|
||||||
{ _lwPos :: Point2
|
{ _lwPos :: Point2
|
||||||
@@ -18,3 +21,4 @@ data LinearShockwave = LinearShockwave
|
|||||||
|
|
||||||
makeLenses ''LinearShockwave
|
makeLenses ''LinearShockwave
|
||||||
deriveJSON defaultOptions ''LinearShockwave
|
deriveJSON defaultOptions ''LinearShockwave
|
||||||
|
$($(derive [d| instance Deriving (Store LinearShockwave) |]))
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ module Dodge.Data.Machine (
|
|||||||
module Dodge.Data.GenParams,
|
module Dodge.Data.GenParams,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -25,6 +26,8 @@ import Dodge.Data.Material
|
|||||||
import Dodge.Data.ObjectType
|
import Dodge.Data.ObjectType
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
import Sound.Data
|
import Sound.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data Machine = Machine
|
data Machine = Machine
|
||||||
{ _mcID :: Int
|
{ _mcID :: Int
|
||||||
@@ -64,3 +67,6 @@ makePrisms ''MachineType
|
|||||||
deriveJSON defaultOptions ''Machine
|
deriveJSON defaultOptions ''Machine
|
||||||
deriveJSON defaultOptions ''MachineType
|
deriveJSON defaultOptions ''MachineType
|
||||||
deriveJSON defaultOptions ''Turret
|
deriveJSON defaultOptions ''Turret
|
||||||
|
$($(derive [d| instance Deriving (Store Machine) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store MachineType) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Turret) |]))
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Machine.Sensor where
|
module Dodge.Data.Machine.Sensor where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Dodge.Data.GenParams
|
import Dodge.Data.GenParams
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -10,6 +11,8 @@ import Data.Aeson
|
|||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Dodge.Data.Item.Combine
|
import Dodge.Data.Item.Combine
|
||||||
import Dodge.Data.Damage.Type
|
import Dodge.Data.Damage.Type
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data Sensor
|
data Sensor
|
||||||
= DamageSensor
|
= DamageSensor
|
||||||
@@ -41,3 +44,6 @@ makeLenses ''ProximityRequirement
|
|||||||
deriveJSON defaultOptions ''Sensor
|
deriveJSON defaultOptions ''Sensor
|
||||||
deriveJSON defaultOptions ''ProximityRequirement
|
deriveJSON defaultOptions ''ProximityRequirement
|
||||||
deriveJSON defaultOptions ''CloseToggle
|
deriveJSON defaultOptions ''CloseToggle
|
||||||
|
$($(derive [d| instance Deriving (Store Sensor) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store ProximityRequirement) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store CloseToggle) |]))
|
||||||
|
|||||||
@@ -3,10 +3,13 @@
|
|||||||
|
|
||||||
module Dodge.Data.Magnet where
|
module Dodge.Data.Magnet where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
newtype MagnetUpdate = MagnetUpdateTimer Int
|
newtype MagnetUpdate = MagnetUpdateTimer Int
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
@@ -28,3 +31,6 @@ makeLenses ''Magnet
|
|||||||
deriveJSON defaultOptions ''MagnetUpdate
|
deriveJSON defaultOptions ''MagnetUpdate
|
||||||
deriveJSON defaultOptions ''MagnetBuBu
|
deriveJSON defaultOptions ''MagnetBuBu
|
||||||
deriveJSON defaultOptions ''Magnet
|
deriveJSON defaultOptions ''Magnet
|
||||||
|
$($(derive [d| instance Deriving (Store MagnetUpdate) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store MagnetBuBu) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Magnet) |]))
|
||||||
|
|||||||
@@ -7,8 +7,11 @@ module Dodge.Data.Material where
|
|||||||
|
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data Material = Wood | Dirt | Stone | Glass | Metal | Crystal | Flesh | Electronics
|
data Material = Wood | Dirt | Stone | Glass | Metal | Crystal | Flesh | Electronics
|
||||||
deriving (Eq, Ord, Show, Bounded, Enum, Read)
|
deriving (Eq, Ord, Show, Bounded, Enum, Read)
|
||||||
|
|
||||||
deriveJSON defaultOptions ''Material
|
deriveJSON defaultOptions ''Material
|
||||||
|
$($(derive [d| instance Deriving (Store Material) |]))
|
||||||
|
|||||||
@@ -3,11 +3,14 @@
|
|||||||
|
|
||||||
module Dodge.Data.Modification where
|
module Dodge.Data.Modification where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Dodge.Data.WorldEffect
|
import Dodge.Data.WorldEffect
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data Modification
|
data Modification
|
||||||
= ModIDTimerPoint3Bool
|
= ModIDTimerPoint3Bool
|
||||||
@@ -28,3 +31,4 @@ data Modification
|
|||||||
|
|
||||||
makeLenses ''Modification
|
makeLenses ''Modification
|
||||||
deriveJSON defaultOptions ''Modification
|
deriveJSON defaultOptions ''Modification
|
||||||
|
$($(derive [d| instance Deriving (Store Modification) |]))
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ module Dodge.Data.MountedObject where
|
|||||||
|
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data MountedObject
|
data MountedObject
|
||||||
= MountedLS Int
|
= MountedLS Int
|
||||||
@@ -12,3 +14,4 @@ data MountedObject
|
|||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
deriveJSON defaultOptions ''MountedObject
|
deriveJSON defaultOptions ''MountedObject
|
||||||
|
$($(derive [d| instance Deriving (Store MountedObject) |]))
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ module Dodge.Data.ObjectType where
|
|||||||
|
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data ObjectType
|
data ObjectType
|
||||||
= ObTerminal
|
= ObTerminal
|
||||||
@@ -25,3 +27,4 @@ instance ToJSONKey ObjectType
|
|||||||
instance FromJSONKey ObjectType
|
instance FromJSONKey ObjectType
|
||||||
|
|
||||||
deriveJSON defaultOptions ''ObjectType
|
deriveJSON defaultOptions ''ObjectType
|
||||||
|
$($(derive [d| instance Deriving (Store ObjectType) |]))
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
{-# LANGUAGE ScopedTypeVariables #-}
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
{-# LANGUAGE StrictData #-}
|
{-# LANGUAGE StrictData #-}
|
||||||
{-# LANGUAGE TemplateHaskell #-}
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
|
{-# LANGUAGE FlexibleInstances #-}
|
||||||
{-# OPTIONS_GHC -fno-warn-orphans #-}
|
{-# OPTIONS_GHC -fno-warn-orphans #-}
|
||||||
|
|
||||||
{- |
|
{- |
|
||||||
@@ -10,12 +11,14 @@ The warnings have been disabled.
|
|||||||
-}
|
-}
|
||||||
module Dodge.Data.PathGraph where
|
module Dodge.Data.PathGraph where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Graph.Inductive
|
import Data.Graph.Inductive
|
||||||
import Data.Map.Strict (Map)
|
import Data.Map.Strict (Map)
|
||||||
import qualified Data.Set as Set
|
import qualified Data.Set as Set
|
||||||
import Data.Store
|
import Data.Store
|
||||||
|
import Data.Store.TH
|
||||||
import GHC.Generics
|
import GHC.Generics
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
import TH.Derive
|
import TH.Derive
|
||||||
@@ -65,9 +68,15 @@ instance (FromJSON a, FromJSON b) => FromJSON (Gr a b)
|
|||||||
|
|
||||||
makeLenses ''PathGraph
|
makeLenses ''PathGraph
|
||||||
makeLenses ''PathEdge
|
makeLenses ''PathEdge
|
||||||
$( $( derive
|
|
||||||
[d|
|
{- FOURMOLU_DISABLE -}
|
||||||
instance Store a => Deriving (Store (Gr a))
|
$($(derive [d|
|
||||||
|]
|
instance Deriving (Store EdgeObstacle)
|
||||||
)
|
|]))
|
||||||
)
|
$($(derive [d|
|
||||||
|
instance Deriving (Store PathEdge)
|
||||||
|
|]))
|
||||||
|
$($(derive [d|
|
||||||
|
instance Deriving (Store (Gr Point2 PathEdge))
|
||||||
|
|]))
|
||||||
|
{- FOURMOLU_ENABLE -}
|
||||||
|
|||||||
@@ -5,8 +5,11 @@ module Dodge.Data.Payload where
|
|||||||
|
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data Payload = ExplosionPayload | DudPayload
|
data Payload = ExplosionPayload | DudPayload
|
||||||
deriving (Show, Read, Eq, Ord, Enum, Bounded)
|
deriving (Show, Read, Eq, Ord, Enum, Bounded)
|
||||||
|
|
||||||
deriveJSON defaultOptions ''Payload
|
deriveJSON defaultOptions ''Payload
|
||||||
|
$($(derive [d| instance Deriving (Store Payload) |]))
|
||||||
|
|||||||
@@ -3,12 +3,16 @@
|
|||||||
|
|
||||||
module Dodge.Data.PosEvent where
|
module Dodge.Data.PosEvent where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data PosEventType = SparkSpawner
|
data PosEventType = SparkSpawner
|
||||||
|
| HackPosEventType
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
data PosEvent = PosEvent
|
data PosEvent = PosEvent
|
||||||
@@ -21,3 +25,5 @@ data PosEvent = PosEvent
|
|||||||
makeLenses ''PosEvent
|
makeLenses ''PosEvent
|
||||||
deriveJSON defaultOptions ''PosEventType
|
deriveJSON defaultOptions ''PosEventType
|
||||||
deriveJSON defaultOptions ''PosEvent
|
deriveJSON defaultOptions ''PosEvent
|
||||||
|
$($(derive [d| instance Deriving (Store PosEventType) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store PosEvent) |]))
|
||||||
|
|||||||
@@ -3,11 +3,14 @@
|
|||||||
|
|
||||||
module Dodge.Data.PressPlate where
|
module Dodge.Data.PressPlate where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
import Picture
|
import Picture
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data PressPlateEvent
|
data PressPlateEvent
|
||||||
= PressPlateId
|
= PressPlateId
|
||||||
@@ -27,3 +30,5 @@ data PressPlate = PressPlate
|
|||||||
makeLenses ''PressPlate
|
makeLenses ''PressPlate
|
||||||
deriveJSON defaultOptions ''PressPlateEvent
|
deriveJSON defaultOptions ''PressPlateEvent
|
||||||
deriveJSON defaultOptions ''PressPlate
|
deriveJSON defaultOptions ''PressPlate
|
||||||
|
$($(derive [d| instance Deriving (Store PressPlateEvent) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store PressPlate) |]))
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import Data.Aeson.TH
|
|||||||
import Dodge.Data.Item.Use.Consumption.Ammo
|
import Dodge.Data.Item.Use.Consumption.Ammo
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
data Proj
|
data Proj
|
||||||
= Shell
|
= Shell
|
||||||
{ _prjPos :: Point2
|
{ _prjPos :: Point2
|
||||||
@@ -29,3 +31,4 @@ data Proj
|
|||||||
|
|
||||||
makeLenses ''Proj
|
makeLenses ''Proj
|
||||||
deriveJSON defaultOptions ''Proj
|
deriveJSON defaultOptions ''Proj
|
||||||
|
$($(derive [d| instance Deriving (Store Proj) |]))
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import Geometry.Data
|
|||||||
import qualified Quaternion as Q
|
import qualified Quaternion as Q
|
||||||
import Shape.Data
|
import Shape.Data
|
||||||
import ShapePicture.Data
|
import ShapePicture.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data Prop
|
data Prop
|
||||||
= PropZ
|
= PropZ
|
||||||
@@ -75,3 +77,7 @@ deriveJSON defaultOptions ''PropDraw
|
|||||||
deriveJSON defaultOptions ''PropUpdate
|
deriveJSON defaultOptions ''PropUpdate
|
||||||
deriveJSON defaultOptions ''PrWdLsLs
|
deriveJSON defaultOptions ''PrWdLsLs
|
||||||
deriveJSON defaultOptions ''Prop
|
deriveJSON defaultOptions ''Prop
|
||||||
|
$($(derive [d| instance Deriving (Store PropDraw) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store PropUpdate) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store PrWdLsLs) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Prop) |]))
|
||||||
|
|||||||
@@ -3,11 +3,14 @@
|
|||||||
|
|
||||||
module Dodge.Data.RadarBlip where
|
module Dodge.Data.RadarBlip where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Geometry
|
import Geometry
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data RadarBlip = RadarBlip
|
data RadarBlip = RadarBlip
|
||||||
{ _rbColor :: Color
|
{ _rbColor :: Color
|
||||||
@@ -20,3 +23,4 @@ data RadarBlip = RadarBlip
|
|||||||
|
|
||||||
makeLenses ''RadarBlip
|
makeLenses ''RadarBlip
|
||||||
deriveJSON defaultOptions ''RadarBlip
|
deriveJSON defaultOptions ''RadarBlip
|
||||||
|
$($(derive [d| instance Deriving (Store RadarBlip) |]))
|
||||||
|
|||||||
@@ -6,11 +6,14 @@ module Dodge.Data.RadarSweep (
|
|||||||
module Dodge.Data.ObjectType,
|
module Dodge.Data.ObjectType,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Dodge.Data.ObjectType
|
import Dodge.Data.ObjectType
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data RadarSweep = RadarSweep
|
data RadarSweep = RadarSweep
|
||||||
{ _rsPos :: Point2
|
{ _rsPos :: Point2
|
||||||
@@ -22,3 +25,4 @@ data RadarSweep = RadarSweep
|
|||||||
|
|
||||||
makeLenses ''RadarSweep
|
makeLenses ''RadarSweep
|
||||||
deriveJSON defaultOptions ''RadarSweep
|
deriveJSON defaultOptions ''RadarSweep
|
||||||
|
$($(derive [d| instance Deriving (Store RadarSweep) |]))
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import Control.Lens
|
|||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data ShockwaveDirection = OutwardShockwave | InwardShockwave
|
data ShockwaveDirection = OutwardShockwave | InwardShockwave
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
@@ -28,3 +30,5 @@ data Shockwave = Shockwave
|
|||||||
makeLenses ''Shockwave
|
makeLenses ''Shockwave
|
||||||
deriveJSON defaultOptions ''ShockwaveDirection
|
deriveJSON defaultOptions ''ShockwaveDirection
|
||||||
deriveJSON defaultOptions ''Shockwave
|
deriveJSON defaultOptions ''Shockwave
|
||||||
|
$($(derive [d| instance Deriving (Store ShockwaveDirection) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Shockwave) |]))
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ module Dodge.Data.SoundOrigin where
|
|||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Dodge.Data.Material
|
import Dodge.Data.Material
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data SoundOrigin
|
data SoundOrigin
|
||||||
= InventorySound
|
= InventorySound
|
||||||
@@ -40,3 +42,4 @@ instance ToJSONKey SoundOrigin
|
|||||||
instance FromJSONKey SoundOrigin
|
instance FromJSONKey SoundOrigin
|
||||||
|
|
||||||
deriveJSON defaultOptions ''SoundOrigin
|
deriveJSON defaultOptions ''SoundOrigin
|
||||||
|
$($(derive [d| instance Deriving (Store SoundOrigin) |]))
|
||||||
|
|||||||
@@ -3,12 +3,15 @@
|
|||||||
|
|
||||||
module Dodge.Data.Spark where
|
module Dodge.Data.Spark where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Dodge.Data.Damage.Type
|
import Dodge.Data.Damage.Type
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data Spark = Spark
|
data Spark = Spark
|
||||||
{ _skVel :: Point2
|
{ _skVel :: Point2
|
||||||
@@ -22,3 +25,4 @@ data Spark = Spark
|
|||||||
|
|
||||||
makeLenses ''Spark
|
makeLenses ''Spark
|
||||||
deriveJSON defaultOptions ''Spark
|
deriveJSON defaultOptions ''Spark
|
||||||
|
$($(derive [d| instance Deriving (Store Spark) |]))
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Terminal where
|
module Dodge.Data.Terminal where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -10,6 +11,8 @@ import Data.Aeson.TH
|
|||||||
import qualified Data.Map.Strict as M
|
import qualified Data.Map.Strict as M
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
import Dodge.Data.WorldEffect
|
import Dodge.Data.WorldEffect
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data TerminalStatus = TerminalOff | TerminalBusy | TerminalReady
|
data TerminalStatus = TerminalOff | TerminalBusy | TerminalReady
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
@@ -128,3 +131,15 @@ deriveJSON defaultOptions ''BlBl
|
|||||||
deriveJSON defaultOptions ''EffectArguments
|
deriveJSON defaultOptions ''EffectArguments
|
||||||
deriveJSON defaultOptions ''TerminalCommandEffect
|
deriveJSON defaultOptions ''TerminalCommandEffect
|
||||||
deriveJSON defaultOptions ''TerminalCommand
|
deriveJSON defaultOptions ''TerminalCommand
|
||||||
|
$($(derive [d| instance Deriving (Store TerminalStatus) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store TerminalInput) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store TerminalBootProgram) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Terminal) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store TerminalLineString) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store TmTm) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store TerminalLine) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store TerminalToggle) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store BlBl) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store EffectArguments) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store TerminalCommandEffect) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store TerminalCommand) |]))
|
||||||
|
|||||||
@@ -3,12 +3,15 @@
|
|||||||
|
|
||||||
module Dodge.Data.TeslaArc where
|
module Dodge.Data.TeslaArc where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Dodge.Data.ArcStep
|
import Dodge.Data.ArcStep
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data TeslaArc = TeslaArc
|
data TeslaArc = TeslaArc
|
||||||
{ _taPoints :: [Point2]
|
{ _taPoints :: [Point2]
|
||||||
@@ -20,3 +23,4 @@ data TeslaArc = TeslaArc
|
|||||||
|
|
||||||
makeLenses ''TeslaArc
|
makeLenses ''TeslaArc
|
||||||
deriveJSON defaultOptions ''TeslaArc
|
deriveJSON defaultOptions ''TeslaArc
|
||||||
|
$($(derive [d| instance Deriving (Store TeslaArc) |]))
|
||||||
|
|||||||
@@ -3,10 +3,13 @@
|
|||||||
|
|
||||||
module Dodge.Data.TractorBeam where
|
module Dodge.Data.TractorBeam where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data TractorBeam = TractorBeam
|
data TractorBeam = TractorBeam
|
||||||
{ _tbPos :: Point2
|
{ _tbPos :: Point2
|
||||||
@@ -18,3 +21,4 @@ data TractorBeam = TractorBeam
|
|||||||
|
|
||||||
makeLenses ''TractorBeam
|
makeLenses ''TractorBeam
|
||||||
deriveJSON defaultOptions ''TractorBeam
|
deriveJSON defaultOptions ''TractorBeam
|
||||||
|
$($(derive [d| instance Deriving (Store TractorBeam) |]))
|
||||||
|
|||||||
@@ -6,12 +6,15 @@ module Dodge.Data.Wall (
|
|||||||
module Dodge.Data.Material,
|
module Dodge.Data.Material,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Dodge.Data.Material
|
import Dodge.Data.Material
|
||||||
import Geometry
|
import Geometry
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data Wall = Wall
|
data Wall = Wall
|
||||||
{ _wlLine :: (Point2, Point2)
|
{ _wlLine :: (Point2, Point2)
|
||||||
@@ -42,6 +45,7 @@ data Opacity
|
|||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
data WallDraw = DrawForceField
|
data WallDraw = DrawForceField
|
||||||
|
| HackWallDraw
|
||||||
deriving (Eq, Ord, Show, Read, Enum, Bounded)
|
deriving (Eq, Ord, Show, Read, Enum, Bounded)
|
||||||
|
|
||||||
data WallStructure
|
data WallStructure
|
||||||
@@ -61,3 +65,7 @@ deriveJSON defaultOptions ''Wall
|
|||||||
deriveJSON defaultOptions ''Opacity
|
deriveJSON defaultOptions ''Opacity
|
||||||
deriveJSON defaultOptions ''WallDraw
|
deriveJSON defaultOptions ''WallDraw
|
||||||
deriveJSON defaultOptions ''WallStructure
|
deriveJSON defaultOptions ''WallStructure
|
||||||
|
$($(derive [d| instance Deriving (Store Wall) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Opacity) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store WallDraw) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store WallStructure) |]))
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import Dodge.Data.Item
|
|||||||
import Dodge.Data.SoundOrigin
|
import Dodge.Data.SoundOrigin
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
import Sound.Data
|
import Sound.Data
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data ItCrWdWd
|
data ItCrWdWd
|
||||||
= ItCrWdId
|
= ItCrWdId
|
||||||
@@ -81,3 +83,11 @@ deriveJSON defaultOptions ''WdBl
|
|||||||
deriveJSON defaultOptions ''WdP2f
|
deriveJSON defaultOptions ''WdP2f
|
||||||
deriveJSON defaultOptions ''DrWdWd
|
deriveJSON defaultOptions ''DrWdWd
|
||||||
deriveJSON defaultOptions ''TmWdWd
|
deriveJSON defaultOptions ''TmWdWd
|
||||||
|
$($(derive [d| instance Deriving (Store ItCrWdWd) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store WdWd) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store WdP2) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store MdWdWd) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store WdBl) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store WdP2f) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store DrWdWd) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store TmWdWd) |]))
|
||||||
|
|||||||
@@ -5,10 +5,13 @@
|
|||||||
-}
|
-}
|
||||||
module Dodge.GameRoom
|
module Dodge.GameRoom
|
||||||
where
|
where
|
||||||
|
import LinearHelp
|
||||||
import Geometry
|
import Geometry
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import GHC.Generics
|
import GHC.Generics
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data GameRoom = GameRoom
|
data GameRoom = GameRoom
|
||||||
{ _grViewpoints :: [Point2]
|
{ _grViewpoints :: [Point2]
|
||||||
@@ -23,3 +26,4 @@ instance ToJSON GameRoom where
|
|||||||
toEncoding = genericToEncoding defaultOptions
|
toEncoding = genericToEncoding defaultOptions
|
||||||
instance FromJSON GameRoom
|
instance FromJSON GameRoom
|
||||||
makeLenses ''GameRoom
|
makeLenses ''GameRoom
|
||||||
|
$($(derive [d| instance Deriving (Store GameRoom) |]))
|
||||||
|
|||||||
+32
-2
@@ -6,19 +6,48 @@ module Dodge.Save (
|
|||||||
writeSaveSlot,
|
writeSaveSlot,
|
||||||
readSaveSlot,
|
readSaveSlot,
|
||||||
reloadLevelStart,
|
reloadLevelStart,
|
||||||
|
toJSONSaveSlot,
|
||||||
|
fromJSONSaveSlot,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import qualified Data.Store as Store
|
||||||
import Dodge.Concurrent
|
import Dodge.Concurrent
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Dodge.Data.SaveSlot
|
import Dodge.Data.SaveSlot
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import qualified Data.Aeson.Encode.Pretty as AEP
|
import qualified Data.Aeson.Encode.Pretty as AEP
|
||||||
import qualified Data.ByteString.Lazy as BS
|
import qualified Data.ByteString.Lazy as BS
|
||||||
|
import qualified Data.ByteString as BSS
|
||||||
import Dodge.Data.Universe
|
import Dodge.Data.Universe
|
||||||
--import qualified Data.Set as S
|
--import qualified Data.Set as S
|
||||||
import System.Directory
|
import System.Directory
|
||||||
|
|
||||||
writeSaveSlot :: SaveSlot -> Universe -> IO (Universe -> Maybe Universe)
|
writeSaveSlot :: SaveSlot -> Universe -> IO (Universe -> Maybe Universe)
|
||||||
writeSaveSlot ss u = do
|
writeSaveSlot ss u = do
|
||||||
|
putStrLn $ "Saving " ++ saveSlotPath ss
|
||||||
|
createDirectoryIfMissing True "saveSlot"
|
||||||
|
BSS.writeFile (saveSlotPath ss) $
|
||||||
|
Store.encode
|
||||||
|
(u ^. uvWorld . cWorld)
|
||||||
|
return Just
|
||||||
|
|
||||||
|
readSaveSlot :: SaveSlot -> IO (Universe -> Maybe Universe)
|
||||||
|
readSaveSlot ss = do
|
||||||
|
fExists <- doesFileExist $ saveSlotPath ss
|
||||||
|
if fExists
|
||||||
|
then do
|
||||||
|
bsstr <- BSS.readFile $ saveSlotPath ss
|
||||||
|
cwstr <- Store.decodeIO $ bsstr
|
||||||
|
case cwstr of
|
||||||
|
Nothing -> putStrLn "loadSaveSlot failed to read saved file" >> return removescreenlayers
|
||||||
|
Just cw -> return $ \uv -> Just $ uv & uvWorld . cWorld .~ cw
|
||||||
|
& uvScreenLayers .~ []
|
||||||
|
else putStrLn "loadSaveSlot failed to find saved file" >> return removescreenlayers
|
||||||
|
where
|
||||||
|
removescreenlayers = Just . (uvScreenLayers .~ [])
|
||||||
|
|
||||||
|
toJSONSaveSlot :: SaveSlot -> Universe -> IO (Universe -> Maybe Universe)
|
||||||
|
toJSONSaveSlot ss u = do
|
||||||
putStrLn $ "Saving " ++ saveSlotPath ss
|
putStrLn $ "Saving " ++ saveSlotPath ss
|
||||||
createDirectoryIfMissing True "saveSlot"
|
createDirectoryIfMissing True "saveSlot"
|
||||||
BS.writeFile (saveSlotPath ss) $
|
BS.writeFile (saveSlotPath ss) $
|
||||||
@@ -27,8 +56,9 @@ writeSaveSlot ss u = do
|
|||||||
(u ^. uvWorld . cWorld)
|
(u ^. uvWorld . cWorld)
|
||||||
return Just
|
return Just
|
||||||
|
|
||||||
readSaveSlot :: SaveSlot -> IO (Universe -> Maybe Universe)
|
|
||||||
readSaveSlot ss = do
|
fromJSONSaveSlot :: SaveSlot -> IO (Universe -> Maybe Universe)
|
||||||
|
fromJSONSaveSlot ss = do
|
||||||
fExists <- doesFileExist $ saveSlotPath ss
|
fExists <- doesFileExist $ saveSlotPath ss
|
||||||
if fExists
|
if fExists
|
||||||
then do
|
then do
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ module Geometry.ConvexPoly
|
|||||||
, convexPolysOverlap
|
, convexPolysOverlap
|
||||||
, pointInPolyPoints
|
, pointInPolyPoints
|
||||||
) where
|
) where
|
||||||
|
import LinearHelp
|
||||||
import GHC.Generics
|
import GHC.Generics
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
@@ -20,6 +21,8 @@ import Geometry.Intersect
|
|||||||
import Geometry.Polygon
|
import Geometry.Polygon
|
||||||
|
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
--import qualified Control.Foldl as L
|
--import qualified Control.Foldl as L
|
||||||
data ConvexPoly = ConvexPoly
|
data ConvexPoly = ConvexPoly
|
||||||
{ _cpPoints :: [Point2]
|
{ _cpPoints :: [Point2]
|
||||||
@@ -78,3 +81,4 @@ pairPolyPointsIntersect _ _ _ = False
|
|||||||
|
|
||||||
|
|
||||||
makeLenses ''ConvexPoly
|
makeLenses ''ConvexPoly
|
||||||
|
$($(derive [d| instance Deriving (Store ConvexPoly) |]))
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
{-# LANGUAGE StrictData #-}
|
||||||
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
|
module LinearHelp where
|
||||||
|
import Data.Store
|
||||||
|
import Data.Store.TH
|
||||||
|
import TH.Derive
|
||||||
|
import Linear.V2
|
||||||
|
import Linear.V3
|
||||||
|
import Linear.V4
|
||||||
|
|
||||||
|
|
||||||
|
$($(derive [d|
|
||||||
|
instance (Store a => Deriving (Store (V2 a)))
|
||||||
|
|]))
|
||||||
|
$($(derive [d|
|
||||||
|
instance (Store a => Deriving (Store (V3 a)))
|
||||||
|
|]))
|
||||||
|
$($(derive [d|
|
||||||
|
instance (Store a => Deriving (Store (V4 a)))
|
||||||
|
|]))
|
||||||
@@ -1,10 +1,13 @@
|
|||||||
{-# LANGUAGE TemplateHaskell #-}
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
{-# LANGUAGE StrictData #-}
|
{-# LANGUAGE StrictData #-}
|
||||||
{-# LANGUAGE DeriveGeneric #-}
|
{-# LANGUAGE DeriveGeneric #-}
|
||||||
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
module MaybeHelp where
|
module MaybeHelp where
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import GHC.Generics
|
import GHC.Generics
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data Maybe' a = Just' {__Just' :: a} | Nothing'
|
data Maybe' a = Just' {__Just' :: a} | Nothing'
|
||||||
deriving (Eq,Ord,Show,Read,Generic)
|
deriving (Eq,Ord,Show,Read,Generic)
|
||||||
@@ -34,3 +37,4 @@ toggleJust Nothing = Just ()
|
|||||||
toggleJust _ = Nothing
|
toggleJust _ = Nothing
|
||||||
|
|
||||||
makeLenses ''Maybe'
|
makeLenses ''Maybe'
|
||||||
|
$($(derive [d| instance (Store a => Deriving (Store (Maybe' a))) |]))
|
||||||
|
|||||||
@@ -3,11 +3,14 @@
|
|||||||
|
|
||||||
module Picture.Data where
|
module Picture.Data where
|
||||||
|
|
||||||
|
import LinearHelp
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
import Streaming
|
import Streaming
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
|
||||||
data Verx = Verx
|
data Verx = Verx
|
||||||
{ _vxPos :: !Point3
|
{ _vxPos :: !Point3
|
||||||
@@ -88,3 +91,6 @@ makeLenses ''Verx
|
|||||||
deriveJSON defaultOptions ''Verx
|
deriveJSON defaultOptions ''Verx
|
||||||
deriveJSON defaultOptions ''Layer
|
deriveJSON defaultOptions ''Layer
|
||||||
deriveJSON defaultOptions ''ShadNum
|
deriveJSON defaultOptions ''ShadNum
|
||||||
|
$($(derive [d| instance Deriving (Store Verx) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store Layer) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store ShadNum) |]))
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
--{-# LANGUAGE StandaloneDeriving #-}
|
--{-# LANGUAGE StandaloneDeriving #-}
|
||||||
--{-# LANGUAGE DeriveGeneric #-}
|
--{-# LANGUAGE DeriveGeneric #-}
|
||||||
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
{-# OPTIONS_GHC -fno-warn-orphans #-}
|
{-# OPTIONS_GHC -fno-warn-orphans #-}
|
||||||
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
{- |
|
{- |
|
||||||
WARNING: orphan instances concerning Aeson classes and Linear.Quaternion datatypes have been introduced.
|
WARNING: orphan instances concerning Aeson classes and Linear.Quaternion datatypes have been introduced.
|
||||||
The warnings have been disabled.
|
The warnings have been disabled.
|
||||||
@@ -15,6 +17,9 @@ import Geometry.Data
|
|||||||
import Geometry.Vector3D
|
import Geometry.Vector3D
|
||||||
import qualified Linear.Quaternion as Q
|
import qualified Linear.Quaternion as Q
|
||||||
import Linear.Quaternion
|
import Linear.Quaternion
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
import LinearHelp
|
||||||
|
|
||||||
instance ToJSON a => ToJSON (Q.Quaternion a) where
|
instance ToJSON a => ToJSON (Q.Quaternion a) where
|
||||||
toEncoding = genericToEncoding defaultOptions
|
toEncoding = genericToEncoding defaultOptions
|
||||||
@@ -35,3 +40,7 @@ vToQuat a b
|
|||||||
| otherwise = Q.axisAngle cprod (angleVV3 a b)
|
| otherwise = Q.axisAngle cprod (angleVV3 a b)
|
||||||
where
|
where
|
||||||
cprod = crossProd a b
|
cprod = crossProd a b
|
||||||
|
|
||||||
|
$($(derive [d|
|
||||||
|
instance (Store a => Deriving (Store (Quaternion a)))
|
||||||
|
|]))
|
||||||
|
|||||||
@@ -6,11 +6,14 @@
|
|||||||
{-# LANGUAGE GeneralisedNewtypeDeriving #-}
|
{-# LANGUAGE GeneralisedNewtypeDeriving #-}
|
||||||
module Shape.Data
|
module Shape.Data
|
||||||
where
|
where
|
||||||
|
import LinearHelp
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
import GHC.Generics
|
import GHC.Generics
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Streaming
|
import Streaming
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
type Shape' = Stream (Of ShapeObj) IO ()
|
type Shape' = Stream (Of ShapeObj) IO ()
|
||||||
type Shape = [ShapeObj]
|
type Shape = [ShapeObj]
|
||||||
|
|
||||||
@@ -47,3 +50,6 @@ pairToSV :: (Point3,Point4) -> ShapeV
|
|||||||
pairToSV = uncurry ShapeV
|
pairToSV = uncurry ShapeV
|
||||||
makeLenses ''ShapeV
|
makeLenses ''ShapeV
|
||||||
makeLenses ''ShapeObj
|
makeLenses ''ShapeObj
|
||||||
|
$($(derive [d| instance Deriving (Store ShapeV) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store ShapeObj) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store ShapeType) |]))
|
||||||
|
|||||||
+10
-8
@@ -3,6 +3,9 @@
|
|||||||
|
|
||||||
module Sound.Data where
|
module Sound.Data where
|
||||||
|
|
||||||
|
import TH.Derive
|
||||||
|
import Data.Store
|
||||||
|
import LinearHelp
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
@@ -18,8 +21,6 @@ data SoundStatus = SoundStatus
|
|||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show)
|
deriving (Eq, Ord, Show)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- TODO make this more sensible (use product rather than union in some cases)
|
-- TODO make this more sensible (use product rather than union in some cases)
|
||||||
data PlayStatus
|
data PlayStatus
|
||||||
= JustStartedPlaying
|
= JustStartedPlaying
|
||||||
@@ -29,13 +30,9 @@ data PlayStatus
|
|||||||
| ToStop
|
| ToStop
|
||||||
deriving (Eq, Ord, Show)
|
deriving (Eq, Ord, Show)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
newtype SoundID = SoundID {_getSoundID :: Int}
|
newtype SoundID = SoundID {_getSoundID :: Int}
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
newtype SoundData = SoundData
|
newtype SoundData = SoundData
|
||||||
{ _loadedChunks :: IM.IntMap Mix.Chunk
|
{ _loadedChunks :: IM.IntMap Mix.Chunk
|
||||||
}
|
}
|
||||||
@@ -50,8 +47,6 @@ data ToPlaySound = ToPlaySound
|
|||||||
}
|
}
|
||||||
deriving (Eq, Show)
|
deriving (Eq, Show)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
data Sound = Sound
|
data Sound = Sound
|
||||||
{ _soundTime :: Maybe Int
|
{ _soundTime :: Maybe Int
|
||||||
, _soundStatus :: SoundStatus
|
, _soundStatus :: SoundStatus
|
||||||
@@ -72,3 +67,10 @@ deriveJSON defaultOptions ''SoundStatus
|
|||||||
deriveJSON defaultOptions ''PlayStatus
|
deriveJSON defaultOptions ''PlayStatus
|
||||||
deriveJSON defaultOptions ''SoundID
|
deriveJSON defaultOptions ''SoundID
|
||||||
deriveJSON defaultOptions ''ToPlaySound
|
deriveJSON defaultOptions ''ToPlaySound
|
||||||
|
|
||||||
|
{- FOURMOLU_DISABLE -}
|
||||||
|
$($(derive [d| instance Deriving (Store SoundStatus) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store PlayStatus) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store SoundID) |]))
|
||||||
|
$($(derive [d| instance Deriving (Store ToPlaySound) |]))
|
||||||
|
{- FOURMOLU_ENABLE -}
|
||||||
|
|||||||
Reference in New Issue
Block a user