Add Binary instances
This commit is contained in:
@@ -52,6 +52,7 @@ dependencies:
|
|||||||
- aeson
|
- aeson
|
||||||
- aeson-pretty
|
- aeson-pretty
|
||||||
- store
|
- store
|
||||||
|
- binary
|
||||||
- flat
|
- flat
|
||||||
- th-utilities
|
- th-utilities
|
||||||
- directory
|
- directory
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
module Color where
|
module Color where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Geometry
|
import Geometry
|
||||||
@@ -27,6 +28,7 @@ data PaletteColor
|
|||||||
| WHITE
|
| WHITE
|
||||||
| BLACK
|
| BLACK
|
||||||
deriving (Eq, Ord, Enum, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Enum, Show, Read, Generic, Flat)
|
||||||
|
instance Binary PaletteColor
|
||||||
|
|
||||||
instance ToJSON PaletteColor where
|
instance ToJSON PaletteColor where
|
||||||
toEncoding = genericToEncoding defaultOptions
|
toEncoding = genericToEncoding defaultOptions
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.ActionPlan where
|
module Dodge.Data.ActionPlan where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -23,11 +24,13 @@ data ActionPlan
|
|||||||
, _apGoal :: [Goal]
|
, _apGoal :: [Goal]
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ActionPlan
|
||||||
|
|
||||||
data RandImpulse
|
data RandImpulse
|
||||||
= RandImpulseList [Impulse]
|
= RandImpulseList [Impulse]
|
||||||
| RandImpulseCircMove Float
|
| RandImpulseCircMove Float
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary RandImpulse
|
||||||
|
|
||||||
data Impulse
|
data Impulse
|
||||||
= Move Point2
|
= Move Point2
|
||||||
@@ -62,6 +65,7 @@ data Impulse
|
|||||||
}
|
}
|
||||||
| ImpulseNothing
|
| ImpulseNothing
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Impulse
|
||||||
|
|
||||||
infixr 9 `WaitThen`
|
infixr 9 `WaitThen`
|
||||||
|
|
||||||
@@ -169,6 +173,7 @@ data Action
|
|||||||
, _mainAction :: Action
|
, _mainAction :: Action
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Action
|
||||||
|
|
||||||
data Strategy
|
data Strategy
|
||||||
= Flank Int
|
= Flank Int
|
||||||
@@ -187,12 +192,14 @@ data Strategy
|
|||||||
| Flee
|
| Flee
|
||||||
| MeleeStrike
|
| MeleeStrike
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Strategy
|
||||||
|
|
||||||
data Goal
|
data Goal
|
||||||
= LiveLongAndProsper
|
= LiveLongAndProsper
|
||||||
| Kill Int
|
| Kill Int
|
||||||
| SentinelAt Point2 Float
|
| SentinelAt Point2 Float
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Goal
|
||||||
|
|
||||||
deriveJSON defaultOptions ''ActionPlan
|
deriveJSON defaultOptions ''ActionPlan
|
||||||
deriveJSON defaultOptions ''RandImpulse
|
deriveJSON defaultOptions ''RandImpulse
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.ArcStep where
|
module Dodge.Data.ArcStep where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -19,11 +20,13 @@ data ArcStep = ArcStep
|
|||||||
, _asObject :: CrWlID --Maybe (Either Creature Wall)
|
, _asObject :: CrWlID --Maybe (Either Creature Wall)
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ArcStep
|
||||||
|
|
||||||
data NextArcStep
|
data NextArcStep
|
||||||
= EndArc
|
= EndArc
|
||||||
| DefaultArcStep
|
| DefaultArcStep
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary NextArcStep
|
||||||
|
|
||||||
makeLenses ''ArcStep
|
makeLenses ''ArcStep
|
||||||
deriveJSON defaultOptions ''ArcStep
|
deriveJSON defaultOptions ''ArcStep
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Beam where
|
module Dodge.Data.Beam where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -30,11 +31,13 @@ data Beam = Beam
|
|||||||
, _bmType :: BeamType
|
, _bmType :: BeamType
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Beam
|
||||||
|
|
||||||
data BeamDraw
|
data BeamDraw
|
||||||
= BasicBeamDraw
|
= BasicBeamDraw
|
||||||
| BeamDrawColor Color
|
| BeamDrawColor Color
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary BeamDraw
|
||||||
|
|
||||||
data BeamCombineType
|
data BeamCombineType
|
||||||
= FlameBeamCombine
|
= FlameBeamCombine
|
||||||
@@ -43,6 +46,7 @@ data BeamCombineType
|
|||||||
| SplitBeamCombine
|
| SplitBeamCombine
|
||||||
| NoBeamCombine
|
| NoBeamCombine
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary BeamCombineType
|
||||||
|
|
||||||
data BeamType
|
data BeamType
|
||||||
= BeamCombine
|
= BeamCombine
|
||||||
@@ -50,6 +54,7 @@ data BeamType
|
|||||||
}
|
}
|
||||||
| BeamSimple
|
| BeamSimple
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary BeamType
|
||||||
|
|
||||||
makeLenses ''BeamType
|
makeLenses ''BeamType
|
||||||
makeLenses ''Beam
|
makeLenses ''Beam
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ module Dodge.Data.Block (
|
|||||||
module Dodge.Data.PathGraph,
|
module Dodge.Data.PathGraph,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Color
|
import Color
|
||||||
@@ -35,6 +36,7 @@ data Block = Block
|
|||||||
, _blObstructs :: [(Int, Int, PathEdge)]
|
, _blObstructs :: [(Int, Int, PathEdge)]
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Block
|
||||||
|
|
||||||
data BlockDraw
|
data BlockDraw
|
||||||
= BlockDrawMempty
|
= BlockDrawMempty
|
||||||
@@ -42,11 +44,13 @@ data BlockDraw
|
|||||||
| BlockDraws [BlockDraw]
|
| BlockDraws [BlockDraw]
|
||||||
| BlockDrawColHeightPoss Color Float [Point2]
|
| BlockDrawColHeightPoss Color Float [Point2]
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary BlockDraw
|
||||||
|
|
||||||
data BlSh
|
data BlSh
|
||||||
= BlShMempty
|
= BlShMempty
|
||||||
| BlShConst Shape
|
| BlShConst Shape
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary BlSh
|
||||||
|
|
||||||
makeLenses ''Block
|
makeLenses ''Block
|
||||||
deriveJSON defaultOptions ''Block
|
deriveJSON defaultOptions ''Block
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Bounds where
|
module Dodge.Data.Bounds where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -17,6 +18,7 @@ data Bounds = Bounds
|
|||||||
, _bdMaxY :: Float
|
, _bdMaxY :: Float
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Bounds
|
||||||
|
|
||||||
defaultBounds :: Bounds
|
defaultBounds :: Bounds
|
||||||
defaultBounds = Bounds 0 0 0 0
|
defaultBounds = Bounds 0 0 0 0
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ module Dodge.Data.Bullet
|
|||||||
, module Dodge.Data.Damage
|
, module Dodge.Data.Damage
|
||||||
)where
|
)where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -31,22 +32,27 @@ data Bullet = Bullet
|
|||||||
, _buDamages :: [Damage]
|
, _buDamages :: [Damage]
|
||||||
}
|
}
|
||||||
deriving (Show, Read, Eq, Ord, Generic, Flat)
|
deriving (Show, Read, Eq, Ord, Generic, Flat)
|
||||||
|
instance Binary Bullet
|
||||||
|
|
||||||
data EnergyBallType = IncBall | TeslaBall | ConcBall
|
data EnergyBallType = IncBall | TeslaBall | ConcBall
|
||||||
deriving (Show, Read, Eq, Ord, Enum, Bounded, Generic, Flat)
|
deriving (Show, Read, Eq, Ord, Enum, Bounded, Generic, Flat)
|
||||||
|
instance Binary EnergyBallType
|
||||||
|
|
||||||
data BulletUpdateMod = NoBulletUpdateMod
|
data BulletUpdateMod = NoBulletUpdateMod
|
||||||
| ABulletUpdateMod -- hack for template splicing
|
| ABulletUpdateMod -- hack for template splicing
|
||||||
deriving (Show, Read, Eq, Ord, Enum, Bounded, Generic, Flat)
|
deriving (Show, Read, Eq, Ord, Enum, Bounded, Generic, Flat)
|
||||||
|
instance Binary BulletUpdateMod
|
||||||
|
|
||||||
data BulletEffect
|
data BulletEffect
|
||||||
= DestroyBullet
|
= DestroyBullet
|
||||||
| BounceBullet
|
| BounceBullet
|
||||||
| PenetrateBullet
|
| PenetrateBullet
|
||||||
deriving (Eq, Ord, Show, Read, Enum, Bounded, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Enum, Bounded, Generic, Flat)
|
||||||
|
instance Binary BulletEffect
|
||||||
|
|
||||||
data BulletSpawn = BulBall EnergyBallType | BulSpark
|
data BulletSpawn = BulBall EnergyBallType | BulSpark
|
||||||
deriving (Show, Read, Eq, Ord, Generic, Flat)
|
deriving (Show, Read, Eq, Ord, Generic, Flat)
|
||||||
|
instance Binary BulletSpawn
|
||||||
|
|
||||||
data BulletTrajectory
|
data BulletTrajectory
|
||||||
= BasicBulletTrajectory
|
= BasicBulletTrajectory
|
||||||
@@ -54,6 +60,7 @@ data BulletTrajectory
|
|||||||
| FlechetteTrajectory Point2
|
| FlechetteTrajectory Point2
|
||||||
| MagnetTrajectory Point2
|
| MagnetTrajectory Point2
|
||||||
deriving (Show, Read, Eq, Ord, Generic, Flat)
|
deriving (Show, Read, Eq, Ord, Generic, Flat)
|
||||||
|
instance Binary BulletTrajectory
|
||||||
|
|
||||||
makeLenses ''Bullet
|
makeLenses ''Bullet
|
||||||
deriveJSON defaultOptions ''Bullet
|
deriveJSON defaultOptions ''Bullet
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Button where
|
module Dodge.Data.Button where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Color
|
import Color
|
||||||
@@ -20,6 +21,7 @@ data ButtonDraw
|
|||||||
| DefaultDrawSwitch Color Color
|
| DefaultDrawSwitch Color Color
|
||||||
| DrawNoButton
|
| DrawNoButton
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ButtonDraw
|
||||||
|
|
||||||
data ButtonEvent
|
data ButtonEvent
|
||||||
= ButtonDoNothing
|
= ButtonDoNothing
|
||||||
@@ -46,6 +48,7 @@ data ButtonEvent
|
|||||||
| ButtonAccessTerminal
|
| ButtonAccessTerminal
|
||||||
deriving (Eq, Show, Read, Generic)
|
deriving (Eq, Show, Read, Generic)
|
||||||
--hderiving (Eq, Show, Read, Generic, Flat)
|
--hderiving (Eq, Show, Read, Generic, Flat)
|
||||||
|
--instance Binary ButtonEvent
|
||||||
|
|
||||||
data Button = Button
|
data Button = Button
|
||||||
{ _btPict :: ButtonDraw --Button -> SPic
|
{ _btPict :: ButtonDraw --Button -> SPic
|
||||||
@@ -61,9 +64,11 @@ data Button = Button
|
|||||||
}
|
}
|
||||||
deriving (Eq, Show, Read, Generic)
|
deriving (Eq, Show, Read, Generic)
|
||||||
--hderiving (Eq, Show, Read, Generic, Flat)
|
--hderiving (Eq, Show, Read, Generic, Flat)
|
||||||
|
--instance Binary Button
|
||||||
|
|
||||||
data ButtonState = BtOn | BtOff | BtNoLabel
|
data ButtonState = BtOn | BtOff | BtNoLabel
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ButtonState
|
||||||
|
|
||||||
makeLenses ''Button
|
makeLenses ''Button
|
||||||
makeLenses ''ButtonEvent
|
makeLenses ''ButtonEvent
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ module Dodge.Data.CWorld (
|
|||||||
module Dodge.Data.WorldEffect,
|
module Dodge.Data.WorldEffect,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -114,6 +115,7 @@ data CWCam = CWCam
|
|||||||
, _cwcBoundDist :: (Float, Float, Float, Float) -- NSEW, S and W negative
|
, _cwcBoundDist :: (Float, Float, Float, Float) -- NSEW, S and W negative
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary CWCam
|
||||||
|
|
||||||
data CWorld = CWorld
|
data CWorld = CWorld
|
||||||
--{ _cameraCenter :: Point2
|
--{ _cameraCenter :: Point2
|
||||||
@@ -189,6 +191,7 @@ data CWorld = CWorld
|
|||||||
}
|
}
|
||||||
deriving (Eq, Show, Read, Generic)
|
deriving (Eq, Show, Read, Generic)
|
||||||
--hderiving (Eq, Show, Read, Generic, Flat)
|
--hderiving (Eq, Show, Read, Generic, Flat)
|
||||||
|
--instance Binary CWorld
|
||||||
|
|
||||||
data CWTime = CWTime
|
data CWTime = CWTime
|
||||||
{ _maybeWorld :: Maybe' CWorld
|
{ _maybeWorld :: Maybe' CWorld
|
||||||
@@ -198,6 +201,7 @@ data CWTime = CWTime
|
|||||||
}
|
}
|
||||||
deriving (Eq, Show, Read, Generic)
|
deriving (Eq, Show, Read, Generic)
|
||||||
--hderiving (Eq, Show, Read, Generic, Flat)
|
--hderiving (Eq, Show, Read, Generic, Flat)
|
||||||
|
--instance Binary CWTime
|
||||||
|
|
||||||
|
|
||||||
data CWGen = CWGen
|
data CWGen = CWGen
|
||||||
@@ -208,6 +212,7 @@ data CWGen = CWGen
|
|||||||
, _cwgSeed :: Int
|
, _cwgSeed :: Int
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary CWGen
|
||||||
|
|
||||||
data WorldBeams = WorldBeams
|
data WorldBeams = WorldBeams
|
||||||
{ _blockingBeams :: [Beam]
|
{ _blockingBeams :: [Beam]
|
||||||
@@ -216,6 +221,7 @@ data WorldBeams = WorldBeams
|
|||||||
, _electronBeams :: [Beam]
|
, _electronBeams :: [Beam]
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary WorldBeams
|
||||||
|
|
||||||
deriveJSON defaultOptions ''CWorld
|
deriveJSON defaultOptions ''CWorld
|
||||||
deriveJSON defaultOptions ''WorldBeams
|
deriveJSON defaultOptions ''WorldBeams
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.CamouflageStatus where
|
module Dodge.Data.CamouflageStatus where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
@@ -13,5 +14,6 @@ data CamouflageStatus
|
|||||||
= FullyVisible
|
= FullyVisible
|
||||||
| Invisible
|
| Invisible
|
||||||
deriving (Eq, Ord, Enum, Read, Show, Bounded, Generic, Flat)
|
deriving (Eq, Ord, Enum, Read, Show, Bounded, Generic, Flat)
|
||||||
|
instance Binary CamouflageStatus
|
||||||
|
|
||||||
deriveJSON defaultOptions ''CamouflageStatus
|
deriveJSON defaultOptions ''CamouflageStatus
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Cloud where
|
module Dodge.Data.Cloud where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -16,6 +17,7 @@ data CloudDraw
|
|||||||
= CloudColor Float Float Color -- radius-multiply fade-time color
|
= CloudColor Float Float Color -- radius-multiply fade-time color
|
||||||
| DrawGasCloud Color
|
| DrawGasCloud Color
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary CloudDraw
|
||||||
|
|
||||||
data Cloud = Cloud
|
data Cloud = Cloud
|
||||||
{ _clPos :: Point3
|
{ _clPos :: Point3
|
||||||
@@ -27,11 +29,13 @@ data Cloud = Cloud
|
|||||||
, _clType :: CloudType
|
, _clType :: CloudType
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Cloud
|
||||||
|
|
||||||
data CloudType
|
data CloudType
|
||||||
= SmokeCloud
|
= SmokeCloud
|
||||||
| GasCloud
|
| GasCloud
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary CloudType
|
||||||
|
|
||||||
makeLenses ''Cloud
|
makeLenses ''Cloud
|
||||||
deriveJSON defaultOptions ''CloudDraw
|
deriveJSON defaultOptions ''CloudDraw
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Corpse where
|
module Dodge.Data.Corpse where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -15,6 +16,7 @@ import ShapePicture.Data
|
|||||||
|
|
||||||
data CorpseResurrection = NoResurrection
|
data CorpseResurrection = NoResurrection
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary CorpseResurrection
|
||||||
|
|
||||||
data Corpse = Corpse
|
data Corpse = Corpse
|
||||||
{ _cpID :: Int
|
{ _cpID :: Int
|
||||||
@@ -24,6 +26,7 @@ data Corpse = Corpse
|
|||||||
, _cpRes :: CorpseResurrection
|
, _cpRes :: CorpseResurrection
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Corpse
|
||||||
|
|
||||||
makeLenses ''Corpse
|
makeLenses ''Corpse
|
||||||
deriveJSON defaultOptions ''CorpseResurrection
|
deriveJSON defaultOptions ''CorpseResurrection
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.CrGroupParams where
|
module Dodge.Data.CrGroupParams where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -20,9 +21,11 @@ data CrGroupParams = CrGroupParams
|
|||||||
, _crGroupUpdate :: CrGroupUpdate --World -> CrGroupParams -> Maybe CrGroupParams
|
, _crGroupUpdate :: CrGroupUpdate --World -> CrGroupParams -> Maybe CrGroupParams
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary CrGroupParams
|
||||||
|
|
||||||
data CrGroupUpdate = DefaultCrGroupUpdate
|
data CrGroupUpdate = DefaultCrGroupUpdate
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary CrGroupUpdate
|
||||||
|
|
||||||
makeLenses ''CrGroupParams
|
makeLenses ''CrGroupParams
|
||||||
deriveJSON defaultOptions ''CrGroupParams
|
deriveJSON defaultOptions ''CrGroupParams
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.CrWlID where
|
module Dodge.Data.CrWlID where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -14,6 +15,7 @@ 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, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary CrWlID
|
||||||
|
|
||||||
makeLenses ''CrWlID
|
makeLenses ''CrWlID
|
||||||
deriveJSON defaultOptions ''CrWlID
|
deriveJSON defaultOptions ''CrWlID
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ module Dodge.Data.Creature (
|
|||||||
module Dodge.Data.Hammer,
|
module Dodge.Data.Hammer,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -76,9 +77,11 @@ data Creature = Creature
|
|||||||
, _crCamouflage :: CamouflageStatus
|
, _crCamouflage :: CamouflageStatus
|
||||||
}
|
}
|
||||||
deriving (Eq, Show, Read, Generic, Flat)
|
deriving (Eq, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Creature
|
||||||
|
|
||||||
data CreatureCorpse = MakeDefaultCorpse
|
data CreatureCorpse = MakeDefaultCorpse
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary CreatureCorpse
|
||||||
|
|
||||||
data Intention = Intention
|
data Intention = Intention
|
||||||
{ _targetCr :: Maybe Creature
|
{ _targetCr :: Maybe Creature
|
||||||
@@ -86,6 +89,7 @@ data Intention = Intention
|
|||||||
, _viewPoint :: Maybe Point2
|
, _viewPoint :: Maybe Point2
|
||||||
}
|
}
|
||||||
deriving (Eq, Show, Read, Generic, Flat)
|
deriving (Eq, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Intention
|
||||||
|
|
||||||
crSel :: Creature -> Int
|
crSel :: Creature -> Int
|
||||||
crSel = _iselPos . _crInvSel
|
crSel = _iselPos . _crInvSel
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Creature.Memory where
|
module Dodge.Data.Creature.Memory where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -17,6 +18,7 @@ data Memory = Memory
|
|||||||
, _nodesSearched :: [Int]
|
, _nodesSearched :: [Int]
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Memory
|
||||||
|
|
||||||
makeLenses ''Memory
|
makeLenses ''Memory
|
||||||
deriveJSON defaultOptions ''Memory
|
deriveJSON defaultOptions ''Memory
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ module Dodge.Data.Creature.Misc (
|
|||||||
module Dodge.Data.CamouflageStatus,
|
module Dodge.Data.CamouflageStatus,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -24,6 +25,7 @@ data CreatureStatistics = CreatureStatistics
|
|||||||
, _intelligence :: Int
|
, _intelligence :: Int
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary CreatureStatistics
|
||||||
|
|
||||||
data Vocalization
|
data Vocalization
|
||||||
= Mute
|
= Mute
|
||||||
@@ -34,6 +36,7 @@ data Vocalization
|
|||||||
, _vcCoolDown :: Int
|
, _vcCoolDown :: Int
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Vocalization
|
||||||
|
|
||||||
data CrMvType
|
data CrMvType
|
||||||
= NoMvType
|
= NoMvType
|
||||||
@@ -45,6 +48,7 @@ data CrMvType
|
|||||||
, _mvAimSpeed :: FloatFloat
|
, _mvAimSpeed :: FloatFloat
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary CrMvType
|
||||||
|
|
||||||
data HumanoidAI
|
data HumanoidAI
|
||||||
= YourAI
|
= YourAI
|
||||||
@@ -61,6 +65,7 @@ data HumanoidAI
|
|||||||
| LongAI
|
| LongAI
|
||||||
| MultGunAI
|
| MultGunAI
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary HumanoidAI
|
||||||
|
|
||||||
data CreatureType
|
data CreatureType
|
||||||
= Humanoid
|
= Humanoid
|
||||||
@@ -73,9 +78,11 @@ data CreatureType
|
|||||||
| Lampoid {_lampHeight :: Float, _lampColor :: Point3, _lampLSID :: Maybe Int}
|
| Lampoid {_lampHeight :: Float, _lampColor :: Point3, _lampLSID :: Maybe Int}
|
||||||
| NonDrawnCreature
|
| NonDrawnCreature
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary CreatureType
|
||||||
|
|
||||||
data BarrelType = PlainBarrel | ExplosiveBarrel
|
data BarrelType = PlainBarrel | ExplosiveBarrel
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary BarrelType
|
||||||
|
|
||||||
makeLenses ''CreatureStatistics
|
makeLenses ''CreatureStatistics
|
||||||
makeLenses ''Vocalization
|
makeLenses ''Vocalization
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ module Dodge.Data.Creature.Perception (
|
|||||||
auDist,
|
auDist,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -38,17 +39,20 @@ data Perception = Perception
|
|||||||
, _cpAudition :: Audition
|
, _cpAudition :: Audition
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Perception
|
||||||
|
|
||||||
data Vision = Eyes
|
data Vision = Eyes
|
||||||
{ _viFOV :: FloatFloat
|
{ _viFOV :: FloatFloat
|
||||||
, _viDist :: FloatFloat
|
, _viDist :: FloatFloat
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Vision
|
||||||
|
|
||||||
newtype Audition = Ears
|
newtype Audition = Ears
|
||||||
{ _auDist :: FloatFloat
|
{ _auDist :: FloatFloat
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Audition
|
||||||
|
|
||||||
data Vigilance
|
data Vigilance
|
||||||
= Comatose
|
= Comatose
|
||||||
@@ -57,16 +61,19 @@ data Vigilance
|
|||||||
| Vigilant
|
| Vigilant
|
||||||
| Overstrung
|
| Overstrung
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Vigilance
|
||||||
|
|
||||||
data Attention
|
data Attention
|
||||||
= AttentiveTo {_getAttentiveTo :: IM.IntMap Awareness}
|
= AttentiveTo {_getAttentiveTo :: IM.IntMap Awareness}
|
||||||
| Fixated {_getFixated :: Int}
|
| Fixated {_getFixated :: Int}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Attention
|
||||||
|
|
||||||
data Awareness
|
data Awareness
|
||||||
= Suspicious Float
|
= Suspicious Float
|
||||||
| Cognizant Float
|
| Cognizant Float
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Awareness
|
||||||
|
|
||||||
makeLenses ''Perception
|
makeLenses ''Perception
|
||||||
makeLenses ''Vision
|
makeLenses ''Vision
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Creature.Stance where
|
module Dodge.Data.Creature.Stance where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -18,6 +19,7 @@ data Stance = Stance
|
|||||||
, _strideLength :: Int
|
, _strideLength :: Int
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Stance
|
||||||
|
|
||||||
data Carriage
|
data Carriage
|
||||||
= Walking
|
= Walking
|
||||||
@@ -29,6 +31,7 @@ data Carriage
|
|||||||
| Flying
|
| Flying
|
||||||
| Boosting Point2
|
| Boosting Point2
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Carriage
|
||||||
|
|
||||||
data FootForward
|
data FootForward
|
||||||
= LeftForward
|
= LeftForward
|
||||||
@@ -36,11 +39,13 @@ data FootForward
|
|||||||
| WasLeftForward
|
| WasLeftForward
|
||||||
| WasRightForward
|
| WasRightForward
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary FootForward
|
||||||
|
|
||||||
data Posture
|
data Posture
|
||||||
= Aiming
|
= Aiming
|
||||||
| AtEase
|
| AtEase
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Posture
|
||||||
|
|
||||||
makeLenses ''Stance
|
makeLenses ''Stance
|
||||||
makeLenses ''Carriage
|
makeLenses ''Carriage
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Creature.State where
|
module Dodge.Data.Creature.State where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -20,17 +21,20 @@ data CreatureState = CrSt
|
|||||||
, _csDropsOnDeath :: CreatureDropType
|
, _csDropsOnDeath :: CreatureDropType
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary CreatureState
|
||||||
|
|
||||||
data CreatureDropType
|
data CreatureDropType
|
||||||
= DropAll
|
= DropAll
|
||||||
| DropAmount Int
|
| DropAmount Int
|
||||||
| DropSpecific [Int]
|
| DropSpecific [Int]
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary CreatureDropType
|
||||||
|
|
||||||
data CrSpState
|
data CrSpState
|
||||||
= Barrel {_piercedPoints :: [Point2]}
|
= Barrel {_piercedPoints :: [Point2]}
|
||||||
| GenCr
|
| GenCr
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary CrSpState
|
||||||
|
|
||||||
data Faction
|
data Faction
|
||||||
= GenericFaction Int
|
= GenericFaction Int
|
||||||
@@ -42,6 +46,7 @@ data Faction
|
|||||||
| ColorFaction Color
|
| ColorFaction Color
|
||||||
| PlayerFaction
|
| PlayerFaction
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Faction
|
||||||
|
|
||||||
data CrGroup
|
data CrGroup
|
||||||
= LoneWolf
|
= LoneWolf
|
||||||
@@ -52,6 +57,7 @@ data CrGroup
|
|||||||
| CrGroupID {_crGroupID :: Int}
|
| CrGroupID {_crGroupID :: Int}
|
||||||
| ShieldGroup
|
| ShieldGroup
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary CrGroup
|
||||||
|
|
||||||
makeLenses ''CreatureState
|
makeLenses ''CreatureState
|
||||||
makeLenses ''CrSpState
|
makeLenses ''CrSpState
|
||||||
|
|||||||
@@ -5,29 +5,36 @@
|
|||||||
|
|
||||||
module Dodge.Data.CreatureEffect where
|
module Dodge.Data.CreatureEffect where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
|
|
||||||
data WdCrCr = NoCreatureEffect
|
data WdCrCr = NoCreatureEffect
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary WdCrCr
|
||||||
|
|
||||||
data CrWdImp = NoCrWdImp
|
data CrWdImp = NoCrWdImp
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary CrWdImp
|
||||||
|
|
||||||
data CrWdWd = CrWdWdId
|
data CrWdWd = CrWdWdId
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary CrWdWd
|
||||||
|
|
||||||
data IntImp = NoIntImp
|
data IntImp = NoIntImp
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary IntImp
|
||||||
|
|
||||||
data CrImp
|
data CrImp
|
||||||
= NoCrImp
|
= NoCrImp
|
||||||
| TurnTowardCr Float -- turn amount
|
| TurnTowardCr Float -- turn amount
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary CrImp
|
||||||
|
|
||||||
data P2Imp = P2ImpNo
|
data P2Imp = P2ImpNo
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary P2Imp
|
||||||
|
|
||||||
data WdCrBl
|
data WdCrBl
|
||||||
= WdCrTrue
|
= WdCrTrue
|
||||||
@@ -36,6 +43,7 @@ data WdCrBl
|
|||||||
| WdCrLOSTarget
|
| WdCrLOSTarget
|
||||||
| WdCrSafeDistFromTarget Float
|
| WdCrSafeDistFromTarget Float
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary WdCrBl
|
||||||
|
|
||||||
data CrBl
|
data CrBl
|
||||||
= CrCanShoot
|
= CrCanShoot
|
||||||
@@ -43,26 +51,32 @@ data CrBl
|
|||||||
| CrIsAiming
|
| CrIsAiming
|
||||||
| CrIsAnimate
|
| CrIsAnimate
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary CrBl
|
||||||
|
|
||||||
data MCrAc = MCrNoAction
|
data MCrAc = MCrNoAction
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary MCrAc
|
||||||
|
|
||||||
data CrAc
|
data CrAc
|
||||||
= CrTurnAround
|
= CrTurnAround
|
||||||
| CrFleeFromTarget
|
| CrFleeFromTarget
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary CrAc
|
||||||
|
|
||||||
data P2Ac = P2NoAction
|
data P2Ac = P2NoAction
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary P2Ac
|
||||||
|
|
||||||
data MP2Ac = MP2NoAction
|
data MP2Ac = MP2NoAction
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary MP2Ac
|
||||||
|
|
||||||
data CrWdAc
|
data CrWdAc
|
||||||
= CrWdBFSThenReturn Int
|
= CrWdBFSThenReturn Int
|
||||||
| ChooseMovementSpreadGun
|
| ChooseMovementSpreadGun
|
||||||
| ChooseMovementLtAuto
|
| ChooseMovementLtAuto
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary CrWdAc
|
||||||
|
|
||||||
deriveJSON defaultOptions ''WdCrCr
|
deriveJSON defaultOptions ''WdCrCr
|
||||||
deriveJSON defaultOptions ''CrWdImp
|
deriveJSON defaultOptions ''CrWdImp
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ module Dodge.Data.Damage (
|
|||||||
module Dodge.Data.Damage.Type,
|
module Dodge.Data.Damage.Type,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -30,6 +31,7 @@ data DamageEffect
|
|||||||
| PushBackDamage {_dePushBack :: Float}
|
| PushBackDamage {_dePushBack :: Float}
|
||||||
| NoDamageEffect
|
| NoDamageEffect
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary DamageEffect
|
||||||
|
|
||||||
data Damage = Damage
|
data Damage = Damage
|
||||||
{ _dmType :: DamageType
|
{ _dmType :: DamageType
|
||||||
@@ -40,6 +42,7 @@ data Damage = Damage
|
|||||||
, _dmEffect :: DamageEffect
|
, _dmEffect :: DamageEffect
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Damage
|
||||||
|
|
||||||
isElectrical :: Damage -> Bool
|
isElectrical :: Damage -> Bool
|
||||||
isElectrical dm = case _dmType dm of
|
isElectrical dm = case _dmType dm of
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Damage.Type where
|
module Dodge.Data.Damage.Type where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
@@ -26,6 +27,7 @@ data DamageType
|
|||||||
| POISONDAM
|
| POISONDAM
|
||||||
| ENTERREMENT
|
| ENTERREMENT
|
||||||
deriving (Eq, Ord, Show, Read, Enum, Bounded, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Enum, Bounded, Generic, Flat)
|
||||||
|
instance Binary DamageType
|
||||||
|
|
||||||
instance ToJSONKey DamageType
|
instance ToJSONKey DamageType
|
||||||
|
|
||||||
|
|||||||
@@ -5,14 +5,16 @@
|
|||||||
|
|
||||||
module Dodge.Data.Distortion where
|
module Dodge.Data.Distortion where
|
||||||
|
|
||||||
import Data.Aeson
|
import Data.Binary
|
||||||
import Data.Aeson.TH
|
|
||||||
import Flat
|
import Flat
|
||||||
import Geometry
|
import Geometry
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
|
import Data.Aeson
|
||||||
|
import Data.Aeson.TH
|
||||||
|
|
||||||
data Distortion
|
data Distortion
|
||||||
= RadialDistortion Point2 Point2 Point2 Float
|
= RadialDistortion Point2 Point2 Point2 Float
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Distortion
|
||||||
|
|
||||||
deriveJSON defaultOptions ''Distortion
|
deriveJSON defaultOptions ''Distortion
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ module Dodge.Data.Door (
|
|||||||
module Dodge.Data.WorldEffect,
|
module Dodge.Data.WorldEffect,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -23,12 +24,14 @@ import Geometry.Data
|
|||||||
|
|
||||||
data DoorStatus = DoorOpen | DoorClosed | DoorHalfway | DoorInt Int
|
data DoorStatus = DoorOpen | DoorClosed | DoorHalfway | DoorInt Int
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary DoorStatus
|
||||||
|
|
||||||
data PushSource
|
data PushSource
|
||||||
= PushesItself
|
= PushesItself
|
||||||
| PushedBy Int
|
| PushedBy Int
|
||||||
| NotPushed
|
| NotPushed
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary PushSource
|
||||||
|
|
||||||
data Door = Door
|
data Door = Door
|
||||||
{ _drID :: Int
|
{ _drID :: Int
|
||||||
@@ -49,6 +52,7 @@ data Door = Door
|
|||||||
, _drObstacleType :: EdgeObstacle
|
, _drObstacleType :: EdgeObstacle
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Door
|
||||||
|
|
||||||
makeLenses ''Door
|
makeLenses ''Door
|
||||||
deriveJSON defaultOptions ''DoorStatus
|
deriveJSON defaultOptions ''DoorStatus
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.EnergyBall where
|
module Dodge.Data.EnergyBall where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -24,6 +25,7 @@ data EnergyBall = EnergyBall
|
|||||||
, _ebRot :: Float
|
, _ebRot :: Float
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary EnergyBall
|
||||||
|
|
||||||
makeLenses ''EnergyBall
|
makeLenses ''EnergyBall
|
||||||
deriveJSON defaultOptions ''EnergyBall
|
deriveJSON defaultOptions ''EnergyBall
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Equipment.Misc where
|
module Dodge.Data.Equipment.Misc where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
@@ -17,6 +18,7 @@ data EquipSite
|
|||||||
| GoesOnLegs
|
| GoesOnLegs
|
||||||
| GoesOnSpecial
|
| GoesOnSpecial
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary EquipSite
|
||||||
|
|
||||||
data EquipPosition
|
data EquipPosition
|
||||||
= OnHead
|
= OnHead
|
||||||
@@ -27,6 +29,7 @@ data EquipPosition
|
|||||||
| OnLegs
|
| OnLegs
|
||||||
| OnSpecial
|
| OnSpecial
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary EquipPosition
|
||||||
|
|
||||||
instance ToJSONKey EquipPosition
|
instance ToJSONKey EquipPosition
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Flame where
|
module Dodge.Data.Flame where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -22,6 +23,7 @@ data Flame = Flame
|
|||||||
, _flOriginalVel :: Point2
|
, _flOriginalVel :: Point2
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Flame
|
||||||
|
|
||||||
makeLenses ''Flame
|
makeLenses ''Flame
|
||||||
deriveJSON defaultOptions ''Flame
|
deriveJSON defaultOptions ''Flame
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Flare where
|
module Dodge.Data.Flare where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Color
|
import Color
|
||||||
@@ -27,6 +28,7 @@ data Flare
|
|||||||
, _flareTime :: Int
|
, _flareTime :: Int
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Flare
|
||||||
|
|
||||||
makeLenses ''Flare
|
makeLenses ''Flare
|
||||||
deriveJSON defaultOptions ''Flare
|
deriveJSON defaultOptions ''Flare
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.FloatFunction where
|
module Dodge.Data.FloatFunction where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
@@ -16,5 +17,6 @@ data FloatFloat
|
|||||||
| FloatAbsCheckGreaterLess Float Float Float
|
| FloatAbsCheckGreaterLess Float Float Float
|
||||||
| FloatConst Float
|
| FloatConst Float
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary FloatFloat
|
||||||
|
|
||||||
deriveJSON defaultOptions ''FloatFloat
|
deriveJSON defaultOptions ''FloatFloat
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.FloorItem where
|
module Dodge.Data.FloorItem where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -15,6 +16,7 @@ import Geometry.Data
|
|||||||
|
|
||||||
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, Generic, Flat)
|
deriving (Eq, Show, Read, Generic, Flat)
|
||||||
|
instance Binary FloorItem
|
||||||
|
|
||||||
makeLenses ''FloorItem
|
makeLenses ''FloorItem
|
||||||
deriveJSON defaultOptions ''FloorItem
|
deriveJSON defaultOptions ''FloorItem
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.ForegroundShape where
|
module Dodge.Data.ForegroundShape where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -21,6 +22,7 @@ data ForegroundShape = ForegroundShape
|
|||||||
, _fsSPic :: SPic
|
, _fsSPic :: SPic
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ForegroundShape
|
||||||
|
|
||||||
makeLenses ''ForegroundShape
|
makeLenses ''ForegroundShape
|
||||||
deriveJSON defaultOptions ''ForegroundShape
|
deriveJSON defaultOptions ''ForegroundShape
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.GenParams where
|
module Dodge.Data.GenParams where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -17,9 +18,11 @@ newtype GenParams = GenParams
|
|||||||
{ _sensorCoding :: M.Map DamageType (PaletteColor, DecorationShape)
|
{ _sensorCoding :: M.Map DamageType (PaletteColor, DecorationShape)
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary GenParams
|
||||||
|
|
||||||
data DecorationShape = PLUS | SQUARE | CIRCLE | THREELINES
|
data DecorationShape = PLUS | SQUARE | CIRCLE | THREELINES
|
||||||
deriving (Eq, Ord, Enum, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Enum, Show, Read, Generic, Flat)
|
||||||
|
instance Binary DecorationShape
|
||||||
|
|
||||||
makeLenses ''GenParams
|
makeLenses ''GenParams
|
||||||
deriveJSON defaultOptions ''GenParams
|
deriveJSON defaultOptions ''GenParams
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Gust where
|
module Dodge.Data.Gust where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -19,6 +20,7 @@ data Gust = Gust
|
|||||||
, _guTime :: Int
|
, _guTime :: Int
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Gust
|
||||||
|
|
||||||
makeLenses ''Gust
|
makeLenses ''Gust
|
||||||
deriveJSON defaultOptions ''Gust
|
deriveJSON defaultOptions ''Gust
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.HUD where
|
module Dodge.Data.HUD where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -16,6 +17,7 @@ data HUDElement
|
|||||||
= DisplayInventory {_subInventory :: SubInventory}
|
= DisplayInventory {_subInventory :: SubInventory}
|
||||||
| DisplayCarte
|
| DisplayCarte
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary HUDElement
|
||||||
|
|
||||||
data SubInventory
|
data SubInventory
|
||||||
= NoSubInventory
|
= NoSubInventory
|
||||||
@@ -25,6 +27,7 @@ data SubInventory
|
|||||||
| LockedInventory
|
| LockedInventory
|
||||||
| DisplayTerminal {_termID :: Int}
|
| DisplayTerminal {_termID :: Int}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary SubInventory
|
||||||
|
|
||||||
data HUD = HUD
|
data HUD = HUD
|
||||||
{ _hudElement :: HUDElement
|
{ _hudElement :: HUDElement
|
||||||
@@ -33,6 +36,7 @@ data HUD = HUD
|
|||||||
, _carteRot :: Float
|
, _carteRot :: Float
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary HUD
|
||||||
|
|
||||||
makeLenses ''HUD
|
makeLenses ''HUD
|
||||||
makeLenses ''HUDElement
|
makeLenses ''HUDElement
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Hammer where
|
module Dodge.Data.Hammer where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -14,12 +15,14 @@ data HammerType
|
|||||||
= NoHammer
|
= NoHammer
|
||||||
| HasHammer {_hammerPosition :: HammerPosition}
|
| HasHammer {_hammerPosition :: HammerPosition}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary HammerType
|
||||||
|
|
||||||
data HammerPosition
|
data HammerPosition
|
||||||
= HammerDown
|
= HammerDown
|
||||||
| HammerReleased
|
| HammerReleased
|
||||||
| HammerUp
|
| HammerUp
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary HammerPosition
|
||||||
|
|
||||||
makeLenses ''HammerType
|
makeLenses ''HammerType
|
||||||
deriveJSON defaultOptions ''HammerType
|
deriveJSON defaultOptions ''HammerType
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ module Dodge.Data.Item (
|
|||||||
module Dodge.Data.Item.Location,
|
module Dodge.Data.Item.Location,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -51,6 +52,7 @@ data Item = Item
|
|||||||
, _itParams :: ItemParams
|
, _itParams :: ItemParams
|
||||||
}
|
}
|
||||||
deriving (Eq, Show, Read, Generic, Flat)
|
deriving (Eq, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Item
|
||||||
|
|
||||||
_itUseAimStance :: Item -> AimStance
|
_itUseAimStance :: Item -> AimStance
|
||||||
_itUseAimStance = _aimStance . _heldAim . _itUse
|
_itUseAimStance = _aimStance . _heldAim . _itUse
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Item.Combine where
|
module Dodge.Data.Item.Combine where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -19,9 +20,11 @@ data ItemType = ItemType
|
|||||||
, _iyStack :: Stack
|
, _iyStack :: Stack
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ItemType
|
||||||
|
|
||||||
data Stack = NoStack | Stack ItAmount
|
data Stack = NoStack | Stack ItAmount
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Stack
|
||||||
|
|
||||||
data CraftType
|
data CraftType
|
||||||
= PIPE
|
= PIPE
|
||||||
@@ -71,6 +74,7 @@ data CraftType
|
|||||||
| SIZEMODULE
|
| SIZEMODULE
|
||||||
| GRAVITYMODULE
|
| GRAVITYMODULE
|
||||||
deriving (Eq, Ord, Show, Enum, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Enum, Read, Generic, Flat)
|
||||||
|
instance Binary CraftType
|
||||||
|
|
||||||
data ItemBaseType
|
data ItemBaseType
|
||||||
= NoItemType
|
= NoItemType
|
||||||
@@ -80,11 +84,13 @@ data ItemBaseType
|
|||||||
| Consumable {_ibtConsumable :: ConsumableItemType}
|
| Consumable {_ibtConsumable :: ConsumableItemType}
|
||||||
| CRAFT CraftType
|
| CRAFT CraftType
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ItemBaseType
|
||||||
|
|
||||||
data ConsumableItemType
|
data ConsumableItemType
|
||||||
= MEDKIT Int
|
= MEDKIT Int
|
||||||
| EXPLOSIVES
|
| EXPLOSIVES
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ConsumableItemType
|
||||||
|
|
||||||
data EquipItemType
|
data EquipItemType
|
||||||
= MAGSHIELD
|
= MAGSHIELD
|
||||||
@@ -101,6 +107,7 @@ data EquipItemType
|
|||||||
| JETPACK
|
| JETPACK
|
||||||
| AUTODETECTOR Detector
|
| AUTODETECTOR Detector
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary EquipItemType
|
||||||
|
|
||||||
data LeftItemType
|
data LeftItemType
|
||||||
= BOOSTER
|
= BOOSTER
|
||||||
@@ -110,6 +117,7 @@ data LeftItemType
|
|||||||
| SHRINKER
|
| SHRINKER
|
||||||
| SPAWNER
|
| SPAWNER
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary LeftItemType
|
||||||
|
|
||||||
data HeldItemType
|
data HeldItemType
|
||||||
= BANGSTICK {_xNum :: Int}
|
= BANGSTICK {_xNum :: Int}
|
||||||
@@ -158,6 +166,7 @@ data HeldItemType
|
|||||||
| FLATSHIELD
|
| FLATSHIELD
|
||||||
| KEYCARD Int
|
| KEYCARD Int
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary HeldItemType
|
||||||
|
|
||||||
data ItemModuleType
|
data ItemModuleType
|
||||||
= EMPTYMODULE
|
= EMPTYMODULE
|
||||||
@@ -183,12 +192,14 @@ data ItemModuleType
|
|||||||
| EXTRABATTERY
|
| EXTRABATTERY
|
||||||
| ATTACHTORCH
|
| ATTACHTORCH
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ItemModuleType
|
||||||
|
|
||||||
data Detector
|
data Detector
|
||||||
= ITEMDETECTOR
|
= ITEMDETECTOR
|
||||||
| CREATUREDETECTOR
|
| CREATUREDETECTOR
|
||||||
| WALLDETECTOR
|
| WALLDETECTOR
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Detector
|
||||||
|
|
||||||
data ModuleSlot
|
data ModuleSlot
|
||||||
= ModBullet
|
= ModBullet
|
||||||
@@ -203,6 +214,7 @@ data ModuleSlot
|
|||||||
| ModDualBeam
|
| ModDualBeam
|
||||||
| ModHeldAttach
|
| ModHeldAttach
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ModuleSlot
|
||||||
|
|
||||||
instance ToJSONKey ModuleSlot
|
instance ToJSONKey ModuleSlot
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Item.CurseStatus where
|
module Dodge.Data.Item.CurseStatus where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
@@ -14,5 +15,6 @@ data CurseStatus
|
|||||||
| UndroppableIdentified
|
| UndroppableIdentified
|
||||||
| UndroppableUnidentified
|
| UndroppableUnidentified
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary CurseStatus
|
||||||
|
|
||||||
deriveJSON defaultOptions ''CurseStatus
|
deriveJSON defaultOptions ''CurseStatus
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Item.Effect where
|
module Dodge.Data.Item.Effect where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -18,6 +19,7 @@ data ItEffect = ItEffect
|
|||||||
, _ieOnStash :: ItInvEffect
|
, _ieOnStash :: ItInvEffect
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ItEffect
|
||||||
|
|
||||||
data ItInvEffect
|
data ItInvEffect
|
||||||
= NoInvEffect
|
= NoInvEffect
|
||||||
@@ -28,12 +30,15 @@ data ItInvEffect
|
|||||||
| RemoveShieldWall
|
| RemoveShieldWall
|
||||||
| EffectWhileHeld ItInvEffect
|
| EffectWhileHeld ItInvEffect
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ItInvEffect
|
||||||
|
|
||||||
data ItFloorEffect = NoFloorEffect
|
data ItFloorEffect = NoFloorEffect
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ItFloorEffect
|
||||||
|
|
||||||
data ItDropEffect = NoDropEffect
|
data ItDropEffect = NoDropEffect
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ItDropEffect
|
||||||
|
|
||||||
makeLenses ''ItEffect
|
makeLenses ''ItEffect
|
||||||
deriveJSON defaultOptions ''ItEffect
|
deriveJSON defaultOptions ''ItEffect
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Item.HeldDelay where
|
module Dodge.Data.Item.HeldDelay where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -27,6 +28,7 @@ data UseDelay -- should just be Delay
|
|||||||
, _warmMax :: Int
|
, _warmMax :: Int
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary UseDelay
|
||||||
|
|
||||||
makeLenses ''UseDelay
|
makeLenses ''UseDelay
|
||||||
deriveJSON defaultOptions ''UseDelay
|
deriveJSON defaultOptions ''UseDelay
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Item.HeldScroll where
|
module Dodge.Data.Item.HeldScroll where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -21,6 +22,7 @@ data HeldScroll
|
|||||||
, _hsMaxInt :: Int
|
, _hsMaxInt :: Int
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary HeldScroll
|
||||||
|
|
||||||
makeLenses ''HeldScroll
|
makeLenses ''HeldScroll
|
||||||
deriveJSON defaultOptions ''HeldScroll
|
deriveJSON defaultOptions ''HeldScroll
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Item.HeldUse where
|
module Dodge.Data.Item.HeldUse where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
@@ -28,11 +29,13 @@ data HeldUse
|
|||||||
| HeldForceField
|
| HeldForceField
|
||||||
| HeldShatter
|
| HeldShatter
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary HeldUse
|
||||||
|
|
||||||
data Cuse
|
data Cuse
|
||||||
= CDoNothing
|
= CDoNothing
|
||||||
| CHeal Int
|
| CHeal Int
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Cuse
|
||||||
|
|
||||||
data Euse
|
data Euse
|
||||||
= EDoNothing
|
= EDoNothing
|
||||||
@@ -44,6 +47,7 @@ data Euse
|
|||||||
| EonWristShield
|
| EonWristShield
|
||||||
| EoffWristShield
|
| EoffWristShield
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Euse
|
||||||
|
|
||||||
data Luse
|
data Luse
|
||||||
= LDoNothing
|
= LDoNothing
|
||||||
@@ -53,6 +57,7 @@ data Luse
|
|||||||
| LUnsafeBlink
|
| LUnsafeBlink
|
||||||
| LBoost
|
| LBoost
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Luse
|
||||||
|
|
||||||
data HeldMod
|
data HeldMod
|
||||||
= HeldModNothing
|
= HeldModNothing
|
||||||
@@ -91,6 +96,7 @@ data HeldMod
|
|||||||
| RevolverXRepeatMod
|
| RevolverXRepeatMod
|
||||||
| BangConeMod
|
| BangConeMod
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary HeldMod
|
||||||
|
|
||||||
deriveJSON defaultOptions ''Cuse
|
deriveJSON defaultOptions ''Cuse
|
||||||
deriveJSON defaultOptions ''HeldMod
|
deriveJSON defaultOptions ''HeldMod
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
{-# LANGUAGE TemplateHaskell #-}
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
module Dodge.Data.Item.Location where
|
module Dodge.Data.Item.Location where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -15,6 +16,7 @@ data ItemLocation
|
|||||||
| OnFloor {_ipFlID :: Int}
|
| OnFloor {_ipFlID :: Int}
|
||||||
| InVoid
|
| InVoid
|
||||||
deriving (Eq, Show, Read, Ord, Generic, Flat)
|
deriving (Eq, Show, Read, Ord, Generic, Flat)
|
||||||
|
instance Binary ItemLocation
|
||||||
|
|
||||||
makeLenses ''ItemLocation
|
makeLenses ''ItemLocation
|
||||||
deriveJSON defaultOptions ''ItemLocation
|
deriveJSON defaultOptions ''ItemLocation
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Item.Misc where
|
module Dodge.Data.Item.Misc where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -18,6 +19,7 @@ data ItemDimension = ItemDimension
|
|||||||
, _dimAttachPos :: Point3
|
, _dimAttachPos :: Point3
|
||||||
}
|
}
|
||||||
deriving (Eq, Show, Read, Generic, Flat)
|
deriving (Eq, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ItemDimension
|
||||||
|
|
||||||
data ItemPortage
|
data ItemPortage
|
||||||
= HeldItem
|
= HeldItem
|
||||||
@@ -27,15 +29,18 @@ data ItemPortage
|
|||||||
| WornItem
|
| WornItem
|
||||||
| NoPortage
|
| NoPortage
|
||||||
deriving (Eq, Show, Read, Generic, Flat)
|
deriving (Eq, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ItemPortage
|
||||||
|
|
||||||
--data ItemValue = ItemValue
|
--data ItemValue = ItemValue
|
||||||
-- { _ivInt :: Int
|
-- { _ivInt :: Int
|
||||||
-- , _ivType :: ItemValueType
|
-- , _ivType :: ItemValueType
|
||||||
-- }
|
-- }
|
||||||
-- deriving (Eq, Show, Read, Generic, Flat)
|
-- deriving (Eq, Show, Read, Generic, Flat)
|
||||||
|
-- instance Binary ItemValue
|
||||||
--
|
--
|
||||||
--data ItemValueType = MundaneItem | ArtefactItem
|
--data ItemValueType = MundaneItem | ArtefactItem
|
||||||
-- deriving (Eq, Show, Read, Generic, Flat)
|
-- deriving (Eq, Show, Read, Generic, Flat)
|
||||||
|
-- instance Binary ItemValueType
|
||||||
|
|
||||||
makeLenses ''ItemDimension
|
makeLenses ''ItemDimension
|
||||||
makeLenses ''ItemPortage
|
makeLenses ''ItemPortage
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Item.Params where
|
module Dodge.Data.Item.Params where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -70,12 +71,15 @@ data ItemParams
|
|||||||
| ParamMID {_paramMID :: Maybe Int}
|
| ParamMID {_paramMID :: Maybe Int}
|
||||||
| BoostPropIX {_boostPropIX :: Maybe Int}
|
| BoostPropIX {_boostPropIX :: Maybe Int}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ItemParams
|
||||||
|
|
||||||
data ShrinkGunStatus = FullSize | Shrunk
|
data ShrinkGunStatus = FullSize | Shrunk
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ShrinkGunStatus
|
||||||
|
|
||||||
data PreviousArcEffect = NoPreviousArcEffect | PerturbTillBreakPreviousArc
|
data PreviousArcEffect = NoPreviousArcEffect | PerturbTillBreakPreviousArc
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary PreviousArcEffect
|
||||||
|
|
||||||
data GunBarrels
|
data GunBarrels
|
||||||
= MultiBarrel
|
= MultiBarrel
|
||||||
@@ -89,6 +93,7 @@ data GunBarrels
|
|||||||
}
|
}
|
||||||
| SingleBarrel {_brlInaccuracy :: Float}
|
| SingleBarrel {_brlInaccuracy :: Float}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary GunBarrels
|
||||||
|
|
||||||
data Nozzle = Nozzle
|
data Nozzle = Nozzle
|
||||||
{ _nzPressure :: Float
|
{ _nzPressure :: Float
|
||||||
@@ -99,12 +104,14 @@ data Nozzle = Nozzle
|
|||||||
, _nzLength :: Float
|
, _nzLength :: Float
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Nozzle
|
||||||
|
|
||||||
data BarrelSpread
|
data BarrelSpread
|
||||||
= AlignedBarrels
|
= AlignedBarrels
|
||||||
| SpreadBarrels {_spreadAngle :: Float}
|
| SpreadBarrels {_spreadAngle :: Float}
|
||||||
| RotatingBarrels {_rotatingBarrelInaccuracy :: Float}
|
| RotatingBarrels {_rotatingBarrelInaccuracy :: Float}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary BarrelSpread
|
||||||
|
|
||||||
makeLenses ''BarrelSpread
|
makeLenses ''BarrelSpread
|
||||||
makeLenses ''ItemParams
|
makeLenses ''ItemParams
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Item.Scope where
|
module Dodge.Data.Item.Scope where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -31,6 +32,7 @@ data Scope
|
|||||||
_scopeIsCamera :: Bool
|
_scopeIsCamera :: Bool
|
||||||
}
|
}
|
||||||
deriving (Eq, Show, Read, Generic, Flat)
|
deriving (Eq, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Scope
|
||||||
|
|
||||||
makeLenses ''Scope
|
makeLenses ''Scope
|
||||||
deriveJSON defaultOptions ''Scope
|
deriveJSON defaultOptions ''Scope
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Item.Targeting where
|
module Dodge.Data.Item.Targeting where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -22,6 +23,7 @@ data Targeting
|
|||||||
, _tgActive :: Bool
|
, _tgActive :: Bool
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Targeting
|
||||||
|
|
||||||
data TargetUpdate
|
data TargetUpdate
|
||||||
= NoTargetUpdate
|
= NoTargetUpdate
|
||||||
@@ -30,6 +32,7 @@ data TargetUpdate
|
|||||||
| TargetRBCreatureUpdate
|
| TargetRBCreatureUpdate
|
||||||
| TargetCursorUpdate
|
| TargetCursorUpdate
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary TargetUpdate
|
||||||
|
|
||||||
data TargetDraw
|
data TargetDraw
|
||||||
= NoTargetDraw
|
= NoTargetDraw
|
||||||
@@ -37,6 +40,7 @@ data TargetDraw
|
|||||||
| SimpleDrawTarget
|
| SimpleDrawTarget
|
||||||
| TargetRBCreatureDraw
|
| TargetRBCreatureDraw
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary TargetDraw
|
||||||
|
|
||||||
makeLenses ''Targeting
|
makeLenses ''Targeting
|
||||||
deriveJSON defaultOptions ''Targeting
|
deriveJSON defaultOptions ''Targeting
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Item.Tweak where
|
module Dodge.Data.Item.Tweak where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -17,6 +18,7 @@ data ItemTweaks
|
|||||||
{ _tweakParams :: IM.IntMap TweakParam
|
{ _tweakParams :: IM.IntMap TweakParam
|
||||||
}
|
}
|
||||||
deriving (Eq, Show, Read, Generic, Flat)
|
deriving (Eq, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ItemTweaks
|
||||||
|
|
||||||
data TweakType
|
data TweakType
|
||||||
= TweakPhaseV
|
= TweakPhaseV
|
||||||
@@ -25,6 +27,7 @@ data TweakType
|
|||||||
| TweakSpinAmount
|
| TweakSpinAmount
|
||||||
| TweakThrustDelay
|
| TweakThrustDelay
|
||||||
deriving (Eq, Show, Read, Generic, Flat)
|
deriving (Eq, Show, Read, Generic, Flat)
|
||||||
|
instance Binary TweakType
|
||||||
|
|
||||||
data TweakParam = TweakParam
|
data TweakParam = TweakParam
|
||||||
{ _tweakType :: TweakType -- Int -> Item -> Item
|
{ _tweakType :: TweakType -- Int -> Item -> Item
|
||||||
@@ -32,6 +35,7 @@ data TweakParam = TweakParam
|
|||||||
, _tweakMax :: Int
|
, _tweakMax :: Int
|
||||||
}
|
}
|
||||||
deriving (Eq, Show, Read, Generic, Flat)
|
deriving (Eq, Show, Read, Generic, Flat)
|
||||||
|
instance Binary TweakParam
|
||||||
|
|
||||||
makeLenses ''TweakParam
|
makeLenses ''TweakParam
|
||||||
makeLenses ''ItemTweaks
|
makeLenses ''ItemTweaks
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ module Dodge.Data.Item.Use (
|
|||||||
module Dodge.Data.Hammer,
|
module Dodge.Data.Hammer,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -51,6 +52,7 @@ data ItemUse
|
|||||||
| CraftUse
|
| CraftUse
|
||||||
{_useAmount :: ItAmount}
|
{_useAmount :: ItAmount}
|
||||||
deriving (Eq, Show, Read, Generic, Flat)
|
deriving (Eq, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ItemUse
|
||||||
|
|
||||||
data AimParams = AimParams
|
data AimParams = AimParams
|
||||||
{ _aimWeight :: Int
|
{ _aimWeight :: Int
|
||||||
@@ -61,6 +63,7 @@ data AimParams = AimParams
|
|||||||
, _aimMuzPos :: Float
|
, _aimMuzPos :: Float
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary AimParams
|
||||||
|
|
||||||
data AimStance
|
data AimStance
|
||||||
= TwoHandTwist
|
= TwoHandTwist
|
||||||
@@ -68,6 +71,7 @@ data AimStance
|
|||||||
| OneHand
|
| OneHand
|
||||||
| LeaveHolstered
|
| LeaveHolstered
|
||||||
deriving (Eq, Show, Ord, Enum, Read, Generic, Flat)
|
deriving (Eq, Show, Ord, Enum, Read, Generic, Flat)
|
||||||
|
instance Binary AimStance
|
||||||
|
|
||||||
data ItZoom = ItZoom
|
data ItZoom = ItZoom
|
||||||
{ _itZoomMax :: Float
|
{ _itZoomMax :: Float
|
||||||
@@ -75,6 +79,7 @@ data ItZoom = ItZoom
|
|||||||
, _itZoomFac :: Float
|
, _itZoomFac :: Float
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ItZoom
|
||||||
|
|
||||||
makeLenses ''ItemUse
|
makeLenses ''ItemUse
|
||||||
makeLenses ''AimParams
|
makeLenses ''AimParams
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ module Dodge.Data.Item.Use.Consumption (
|
|||||||
module Dodge.Data.Item.Use.Consumption.LoadAction,
|
module Dodge.Data.Item.Use.Consumption.LoadAction,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -29,6 +30,7 @@ data HeldConsumption
|
|||||||
}
|
}
|
||||||
| NoConsumption
|
| NoConsumption
|
||||||
deriving (Eq, Show, Read, Generic, Flat)
|
deriving (Eq, Show, Read, Generic, Flat)
|
||||||
|
instance Binary HeldConsumption
|
||||||
|
|
||||||
data LeftConsumption
|
data LeftConsumption
|
||||||
= AutoRecharging
|
= AutoRecharging
|
||||||
@@ -42,12 +44,14 @@ data LeftConsumption
|
|||||||
, _wpCharge :: Int
|
, _wpCharge :: Int
|
||||||
}
|
}
|
||||||
deriving (Eq, Show, Read, Generic, Flat)
|
deriving (Eq, Show, Read, Generic, Flat)
|
||||||
|
instance Binary LeftConsumption
|
||||||
|
|
||||||
newtype ItAmount = ItAmount {_getItAmount :: Int}
|
newtype ItAmount = ItAmount {_getItAmount :: Int}
|
||||||
-- deriving (Eq, Ord, Read, Show, Num, Real, Generic, Flat)
|
-- deriving (Eq, Ord, Read, Show, Num, Real, Generic, Flat)
|
||||||
deriving newtype (Eq, Ord, Read, Show, Num, Real, Enum, Integral)
|
deriving newtype (Eq, Ord, Read, Show, Num, Real, Enum, Integral)
|
||||||
deriving stock (Generic)
|
deriving stock (Generic)
|
||||||
deriving anyclass (Flat)
|
deriving anyclass (Flat)
|
||||||
|
instance Binary ItAmount
|
||||||
|
|
||||||
makeLenses ''HeldConsumption
|
makeLenses ''HeldConsumption
|
||||||
makeLenses ''LeftConsumption
|
makeLenses ''LeftConsumption
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ module Dodge.Data.Item.Use.Consumption.Ammo (
|
|||||||
module Dodge.Data.Payload,
|
module Dodge.Data.Payload,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -18,9 +19,11 @@ import Dodge.Data.Payload
|
|||||||
|
|
||||||
data ProjectileDraw = DrawShell | DrawRemoteShell | DrawDrone | DrawBlankProjectile
|
data ProjectileDraw = DrawShell | DrawRemoteShell | DrawDrone | DrawBlankProjectile
|
||||||
deriving (Show, Read, Eq, Ord, Enum, Bounded, Generic, Flat)
|
deriving (Show, Read, Eq, Ord, Enum, Bounded, Generic, Flat)
|
||||||
|
instance Binary ProjectileDraw
|
||||||
|
|
||||||
data ProjectileCreate = CreateShell | CreateTrackingShell
|
data ProjectileCreate = CreateShell | CreateTrackingShell
|
||||||
deriving (Show, Read, Eq, Ord, Enum, Bounded, Generic, Flat)
|
deriving (Show, Read, Eq, Ord, Enum, Bounded, Generic, Flat)
|
||||||
|
instance Binary ProjectileCreate
|
||||||
|
|
||||||
data ProjectileUpdate
|
data ProjectileUpdate
|
||||||
= PJThrust {_pjuStart :: Int, _pjuEnd :: Int}
|
= PJThrust {_pjuStart :: Int, _pjuEnd :: Int}
|
||||||
@@ -34,6 +37,7 @@ data ProjectileUpdate
|
|||||||
| PJShellCollisionCheck
|
| PJShellCollisionCheck
|
||||||
| PJRemoteShellCollisionCheck
|
| PJRemoteShellCollisionCheck
|
||||||
deriving (Show, Read, Eq, Ord, Generic, Flat)
|
deriving (Show, Read, Eq, Ord, Generic, Flat)
|
||||||
|
instance Binary ProjectileUpdate
|
||||||
|
|
||||||
data AmmoType
|
data AmmoType
|
||||||
= ProjectileAmmo
|
= ProjectileAmmo
|
||||||
@@ -57,12 +61,15 @@ data AmmoType
|
|||||||
}
|
}
|
||||||
| GenericAmmo
|
| GenericAmmo
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary AmmoType
|
||||||
|
|
||||||
data ForceFieldType = DefaultForceField
|
data ForceFieldType = DefaultForceField
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ForceFieldType
|
||||||
|
|
||||||
data GasCreate = CreatePoisonGas | CreateFlame
|
data GasCreate = CreatePoisonGas | CreateFlame
|
||||||
deriving (Eq, Ord, Show, Enum, Bounded, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Enum, Bounded, Read, Generic, Flat)
|
||||||
|
instance Binary GasCreate
|
||||||
|
|
||||||
makeLenses ''ProjectileUpdate
|
makeLenses ''ProjectileUpdate
|
||||||
makeLenses ''AmmoType
|
makeLenses ''AmmoType
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Item.Use.Consumption.LoadAction where
|
module Dodge.Data.Item.Use.Consumption.LoadAction where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -18,14 +19,17 @@ data LoadAction
|
|||||||
| LoadAdd {_actionTime :: Int, _actionSound :: SoundID, _insertMax :: Int}
|
| LoadAdd {_actionTime :: Int, _actionSound :: SoundID, _insertMax :: Int}
|
||||||
| LoadPrime {_actionTime :: Int, _actionSound :: SoundID}
|
| LoadPrime {_actionTime :: Int, _actionSound :: SoundID}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary LoadAction
|
||||||
|
|
||||||
data InvSel = InvSel {_iselPos :: Int, _iselAction :: InvSelAction}
|
data InvSel = InvSel {_iselPos :: Int, _iselAction :: InvSelAction}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary InvSel
|
||||||
|
|
||||||
data InvSelAction
|
data InvSelAction
|
||||||
= NoInvSelAction
|
= NoInvSelAction
|
||||||
| ReloadAction {_actionProgress :: Int, _reloadAction :: LoadAction, _actionHammer :: HammerType}
|
| ReloadAction {_actionProgress :: Int, _reloadAction :: LoadAction, _actionHammer :: HammerType}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary InvSelAction
|
||||||
|
|
||||||
makeLenses ''LoadAction
|
makeLenses ''LoadAction
|
||||||
makeLenses ''InvSel
|
makeLenses ''InvSel
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ module Dodge.Data.Item.Use.Equipment (
|
|||||||
module Dodge.Data.Item.Use.Equipment,
|
module Dodge.Data.Item.Use.Equipment,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -24,12 +25,14 @@ data EquipEffect = EquipEffect
|
|||||||
, _eeViewDist :: Maybe Float
|
, _eeViewDist :: Maybe Float
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary EquipEffect
|
||||||
|
|
||||||
data EquipParams
|
data EquipParams
|
||||||
= NoEquipParams
|
= NoEquipParams
|
||||||
| EquipID {_eparamID :: Int}
|
| EquipID {_eparamID :: Int}
|
||||||
| EquipCounter {_eparamInt :: Int}
|
| EquipCounter {_eparamInt :: Int}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary EquipParams
|
||||||
|
|
||||||
makeLenses ''EquipEffect
|
makeLenses ''EquipEffect
|
||||||
makeLenses ''EquipParams
|
makeLenses ''EquipParams
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Laser where
|
module Dodge.Data.Laser where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -16,6 +17,7 @@ data LaserType
|
|||||||
= DamageLaser {_laserTypeDamage :: Int}
|
= DamageLaser {_laserTypeDamage :: Int}
|
||||||
| TargetLaser
|
| TargetLaser
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary LaserType
|
||||||
|
|
||||||
data LaserStart = LaserStart
|
data LaserStart = LaserStart
|
||||||
{ _lpPhaseV :: Float
|
{ _lpPhaseV :: Float
|
||||||
@@ -25,6 +27,7 @@ data LaserStart = LaserStart
|
|||||||
, _lpType :: LaserType
|
, _lpType :: LaserType
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary LaserStart
|
||||||
|
|
||||||
data Laser = Laser
|
data Laser = Laser
|
||||||
{ _laColor :: Color
|
{ _laColor :: Color
|
||||||
@@ -32,6 +35,7 @@ data Laser = Laser
|
|||||||
, _laType :: LaserType
|
, _laType :: LaserType
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Laser
|
||||||
|
|
||||||
makeLenses ''Laser
|
makeLenses ''Laser
|
||||||
makeLenses ''LaserStart
|
makeLenses ''LaserStart
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.LightSource where
|
module Dodge.Data.LightSource where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -14,17 +15,20 @@ import Geometry
|
|||||||
|
|
||||||
data LightSourceDraw = DefaultLightSourceDraw
|
data LightSourceDraw = DefaultLightSourceDraw
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary LightSourceDraw
|
||||||
|
|
||||||
data TLSIntensity
|
data TLSIntensity
|
||||||
= ConstantIntensity
|
= ConstantIntensity
|
||||||
| TLSFade Point3 Int
|
| TLSFade Point3 Int
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary TLSIntensity
|
||||||
|
|
||||||
data TLSUpdate
|
data TLSUpdate
|
||||||
= DestroyTLS
|
= DestroyTLS
|
||||||
| TimerTLS
|
| TimerTLS
|
||||||
| IntensityTLS TLSIntensity
|
| IntensityTLS TLSIntensity
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary TLSUpdate
|
||||||
|
|
||||||
data LSParam = LSParam
|
data LSParam = LSParam
|
||||||
{ _lsPos :: !Point3
|
{ _lsPos :: !Point3
|
||||||
@@ -32,6 +36,7 @@ data LSParam = LSParam
|
|||||||
, _lsCol :: !Point3
|
, _lsCol :: !Point3
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary LSParam
|
||||||
|
|
||||||
data LightSource = LS
|
data LightSource = LS
|
||||||
{ _lsID :: Int
|
{ _lsID :: Int
|
||||||
@@ -40,6 +45,7 @@ data LightSource = LS
|
|||||||
, _lsPict :: LightSourceDraw --LightSource -> Picture
|
, _lsPict :: LightSourceDraw --LightSource -> Picture
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary LightSource
|
||||||
|
|
||||||
data TempLightSource = TLS
|
data TempLightSource = TLS
|
||||||
{ _tlsParam :: LSParam
|
{ _tlsParam :: LSParam
|
||||||
@@ -47,6 +53,7 @@ data TempLightSource = TLS
|
|||||||
, _tlsTime :: Int
|
, _tlsTime :: Int
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary TempLightSource
|
||||||
|
|
||||||
makeLenses ''LSParam
|
makeLenses ''LSParam
|
||||||
makeLenses ''LightSource
|
makeLenses ''LightSource
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.LinearShockwave where
|
module Dodge.Data.LinearShockwave where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -19,6 +20,7 @@ data LinearShockwave = LinearShockwave
|
|||||||
, _lwTimer :: Int
|
, _lwTimer :: Int
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary LinearShockwave
|
||||||
|
|
||||||
makeLenses ''LinearShockwave
|
makeLenses ''LinearShockwave
|
||||||
deriveJSON defaultOptions ''LinearShockwave
|
deriveJSON defaultOptions ''LinearShockwave
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ module Dodge.Data.Machine (
|
|||||||
module Dodge.Data.GenParams,
|
module Dodge.Data.GenParams,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Color
|
import Color
|
||||||
@@ -47,6 +48,7 @@ data Machine = Machine
|
|||||||
}
|
}
|
||||||
deriving (Eq, Show, Read, Generic)
|
deriving (Eq, Show, Read, Generic)
|
||||||
--hderiving (Eq, Show, Read, Generic, Flat)
|
--hderiving (Eq, Show, Read, Generic, Flat)
|
||||||
|
--instance Binary Machine
|
||||||
|
|
||||||
data MachineType
|
data MachineType
|
||||||
= McStatic
|
= McStatic
|
||||||
@@ -55,6 +57,7 @@ data MachineType
|
|||||||
| McTurret Turret
|
| McTurret Turret
|
||||||
deriving (Eq, Show, Read, Generic)
|
deriving (Eq, Show, Read, Generic)
|
||||||
--hderiving (Eq, Show, Read, Generic, Flat)
|
--hderiving (Eq, Show, Read, Generic, Flat)
|
||||||
|
--instance Binary MachineType
|
||||||
|
|
||||||
data Turret = Turret
|
data Turret = Turret
|
||||||
{ _tuWeapon :: Item
|
{ _tuWeapon :: Item
|
||||||
@@ -64,6 +67,7 @@ data Turret = Turret
|
|||||||
}
|
}
|
||||||
deriving (Eq, Show, Read, Generic)
|
deriving (Eq, Show, Read, Generic)
|
||||||
--hderiving (Eq, Show, Read, Generic, Flat)
|
--hderiving (Eq, Show, Read, Generic, Flat)
|
||||||
|
--instance Binary Turret
|
||||||
|
|
||||||
makeLenses ''Machine
|
makeLenses ''Machine
|
||||||
makeLenses ''Turret
|
makeLenses ''Turret
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Machine.Sensor where
|
module Dodge.Data.Machine.Sensor where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Dodge.Data.GenParams
|
import Dodge.Data.GenParams
|
||||||
@@ -30,15 +31,18 @@ data Sensor
|
|||||||
, _sensToggle :: Bool
|
, _sensToggle :: Bool
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Sensor
|
||||||
|
|
||||||
data ProximityRequirement
|
data ProximityRequirement
|
||||||
= RequireHealth {_proxReqMinHealth :: Int}
|
= RequireHealth {_proxReqMinHealth :: Int}
|
||||||
| RequireEquipment {_proxReqEquipment :: ItemBaseType}
|
| RequireEquipment {_proxReqEquipment :: ItemBaseType}
|
||||||
| RequireImpossible
|
| RequireImpossible
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ProximityRequirement
|
||||||
|
|
||||||
data CloseToggle = NotClose | IsClose
|
data CloseToggle = NotClose | IsClose
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary CloseToggle
|
||||||
|
|
||||||
makeLenses ''Sensor
|
makeLenses ''Sensor
|
||||||
makeLenses ''ProximityRequirement
|
makeLenses ''ProximityRequirement
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Magnet where
|
module Dodge.Data.Magnet where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -14,11 +15,13 @@ import Geometry.Data
|
|||||||
|
|
||||||
newtype MagnetUpdate = MagnetUpdateTimer Int
|
newtype MagnetUpdate = MagnetUpdateTimer Int
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary MagnetUpdate
|
||||||
|
|
||||||
data MagnetBuBu
|
data MagnetBuBu
|
||||||
= MagnetBuId
|
= MagnetBuId
|
||||||
| MagnetBuBuCurveAroundField Float Float
|
| MagnetBuBuCurveAroundField Float Float
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary MagnetBuBu
|
||||||
|
|
||||||
data Magnet = Magnet
|
data Magnet = Magnet
|
||||||
{ _mgID :: Int
|
{ _mgID :: Int
|
||||||
@@ -27,6 +30,7 @@ data Magnet = Magnet
|
|||||||
, _mgField :: MagnetBuBu
|
, _mgField :: MagnetBuBu
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Magnet
|
||||||
|
|
||||||
makeLenses ''Magnet
|
makeLenses ''Magnet
|
||||||
deriveJSON defaultOptions ''MagnetUpdate
|
deriveJSON defaultOptions ''MagnetUpdate
|
||||||
|
|||||||
@@ -5,11 +5,13 @@
|
|||||||
|
|
||||||
module Dodge.Data.Material where
|
module Dodge.Data.Material where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
|
|
||||||
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, Generic, Flat)
|
deriving (Eq, Ord, Show, Bounded, Enum, Read, Generic, Flat)
|
||||||
|
instance Binary Material
|
||||||
|
|
||||||
deriveJSON defaultOptions ''Material
|
deriveJSON defaultOptions ''Material
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Modification where
|
module Dodge.Data.Modification where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -29,6 +30,7 @@ data Modification
|
|||||||
, _mdUpdate :: MdWdWd
|
, _mdUpdate :: MdWdWd
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Modification
|
||||||
|
|
||||||
makeLenses ''Modification
|
makeLenses ''Modification
|
||||||
deriveJSON defaultOptions ''Modification
|
deriveJSON defaultOptions ''Modification
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.MountedObject where
|
module Dodge.Data.MountedObject where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
@@ -13,5 +14,6 @@ data MountedObject
|
|||||||
= MountedLS Int
|
= MountedLS Int
|
||||||
| MountedProp Int
|
| MountedProp Int
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary MountedObject
|
||||||
|
|
||||||
deriveJSON defaultOptions ''MountedObject
|
deriveJSON defaultOptions ''MountedObject
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.ObjectType where
|
module Dodge.Data.ObjectType where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
@@ -24,6 +25,7 @@ data ObjectType
|
|||||||
| ObTrigger
|
| ObTrigger
|
||||||
| ObItem
|
| ObItem
|
||||||
deriving (Eq, Show, Ord, Read, Enum, Bounded, Generic, Flat)
|
deriving (Eq, Show, Ord, Read, Enum, Bounded, Generic, Flat)
|
||||||
|
instance Binary ObjectType
|
||||||
|
|
||||||
instance ToJSONKey ObjectType
|
instance ToJSONKey ObjectType
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ The warnings have been disabled.
|
|||||||
-}
|
-}
|
||||||
module Dodge.Data.PathGraph where
|
module Dodge.Data.PathGraph where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -43,6 +44,7 @@ data PathEdge = PathEdge
|
|||||||
, _peObstacles :: Set.Set EdgeObstacle
|
, _peObstacles :: Set.Set EdgeObstacle
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary PathEdge
|
||||||
|
|
||||||
instance ToJSON PathEdge where
|
instance ToJSON PathEdge where
|
||||||
toEncoding = genericToEncoding defaultOptions
|
toEncoding = genericToEncoding defaultOptions
|
||||||
@@ -55,6 +57,7 @@ data EdgeObstacle
|
|||||||
| AutoDoorObstacle
|
| AutoDoorObstacle
|
||||||
| WallObstacle
|
| WallObstacle
|
||||||
deriving (Eq, Ord, Show, Read, Bounded, Enum, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Bounded, Enum, Generic, Flat)
|
||||||
|
instance Binary EdgeObstacle
|
||||||
|
|
||||||
instance ToJSON EdgeObstacle where
|
instance ToJSON EdgeObstacle where
|
||||||
toEncoding = genericToEncoding defaultOptions
|
toEncoding = genericToEncoding defaultOptions
|
||||||
|
|||||||
@@ -5,11 +5,13 @@
|
|||||||
|
|
||||||
module Dodge.Data.Payload where
|
module Dodge.Data.Payload where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
|
|
||||||
data Payload = ExplosionPayload | DudPayload
|
data Payload = ExplosionPayload | DudPayload
|
||||||
deriving (Show, Read, Eq, Ord, Enum, Bounded, Generic, Flat)
|
deriving (Show, Read, Eq, Ord, Enum, Bounded, Generic, Flat)
|
||||||
|
instance Binary Payload
|
||||||
|
|
||||||
deriveJSON defaultOptions ''Payload
|
deriveJSON defaultOptions ''Payload
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.PosEvent where
|
module Dodge.Data.PosEvent where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -14,6 +15,7 @@ import Geometry.Data
|
|||||||
|
|
||||||
data PosEventType = SparkSpawner
|
data PosEventType = SparkSpawner
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary PosEventType
|
||||||
|
|
||||||
data PosEvent = PosEvent
|
data PosEvent = PosEvent
|
||||||
{ _pvType :: PosEventType
|
{ _pvType :: PosEventType
|
||||||
@@ -21,6 +23,7 @@ data PosEvent = PosEvent
|
|||||||
, _pvPos :: Point2
|
, _pvPos :: Point2
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary PosEvent
|
||||||
|
|
||||||
makeLenses ''PosEvent
|
makeLenses ''PosEvent
|
||||||
deriveJSON defaultOptions ''PosEventType
|
deriveJSON defaultOptions ''PosEventType
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.PressPlate where
|
module Dodge.Data.PressPlate where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -17,6 +18,7 @@ data PressPlateEvent
|
|||||||
= PressPlateId
|
= PressPlateId
|
||||||
| PPLevelReset
|
| PPLevelReset
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary PressPlateEvent
|
||||||
|
|
||||||
data PressPlate = PressPlate
|
data PressPlate = PressPlate
|
||||||
{ _ppPict :: Picture
|
{ _ppPict :: Picture
|
||||||
@@ -27,6 +29,7 @@ data PressPlate = PressPlate
|
|||||||
, _ppText :: String
|
, _ppText :: String
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary PressPlate
|
||||||
|
|
||||||
makeLenses ''PressPlate
|
makeLenses ''PressPlate
|
||||||
deriveJSON defaultOptions ''PressPlateEvent
|
deriveJSON defaultOptions ''PressPlateEvent
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Projectile where
|
module Dodge.Data.Projectile where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -29,6 +30,7 @@ data Proj
|
|||||||
, _prjMITID :: Maybe Int
|
, _prjMITID :: Maybe Int
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Proj
|
||||||
|
|
||||||
makeLenses ''Proj
|
makeLenses ''Proj
|
||||||
deriveJSON defaultOptions ''Proj
|
deriveJSON defaultOptions ''Proj
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Prop where
|
module Dodge.Data.Prop where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -40,6 +41,7 @@ data Prop
|
|||||||
, _prToggle :: Bool
|
, _prToggle :: Bool
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Prop
|
||||||
|
|
||||||
data PropDraw
|
data PropDraw
|
||||||
= PropDrawSPic SPic
|
= PropDrawSPic SPic
|
||||||
@@ -52,6 +54,7 @@ data PropDraw
|
|||||||
| PropDrawToggle PropDraw
|
| PropDrawToggle PropDraw
|
||||||
| PropDrawGib Float
|
| PropDrawGib Float
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary PropDraw
|
||||||
|
|
||||||
data PropUpdate
|
data PropUpdate
|
||||||
= PropUpdateAnd PropUpdate PropUpdate
|
= PropUpdateAnd PropUpdate PropUpdate
|
||||||
@@ -66,12 +69,14 @@ data PropUpdate
|
|||||||
| PropUpdateWhen WdBl PropUpdate
|
| PropUpdateWhen WdBl PropUpdate
|
||||||
| PropUpdateIf WdBl PropUpdate PropUpdate
|
| PropUpdateIf WdBl PropUpdate PropUpdate
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary PropUpdate
|
||||||
|
|
||||||
data PrWdLsLs
|
data PrWdLsLs
|
||||||
= PrWdLsId
|
= PrWdLsId
|
||||||
| PrWdLsSetPosition WdP2f Point3
|
| PrWdLsSetPosition WdP2f Point3
|
||||||
| PrWdLsSetColor Point3
|
| PrWdLsSetColor Point3
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary PrWdLsLs
|
||||||
|
|
||||||
makeLenses ''Prop
|
makeLenses ''Prop
|
||||||
deriveJSON defaultOptions ''PropDraw
|
deriveJSON defaultOptions ''PropDraw
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.RadarBlip where
|
module Dodge.Data.RadarBlip where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Color
|
import Color
|
||||||
@@ -21,6 +22,7 @@ data RadarBlip = RadarBlip
|
|||||||
, _rbPos :: Point2
|
, _rbPos :: Point2
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary RadarBlip
|
||||||
|
|
||||||
makeLenses ''RadarBlip
|
makeLenses ''RadarBlip
|
||||||
deriveJSON defaultOptions ''RadarBlip
|
deriveJSON defaultOptions ''RadarBlip
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ module Dodge.Data.RadarSweep (
|
|||||||
module Dodge.Data.ObjectType,
|
module Dodge.Data.ObjectType,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -23,6 +24,7 @@ data RadarSweep = RadarSweep
|
|||||||
, _rsTimer :: Int
|
, _rsTimer :: Int
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary RadarSweep
|
||||||
|
|
||||||
makeLenses ''RadarSweep
|
makeLenses ''RadarSweep
|
||||||
deriveJSON defaultOptions ''RadarSweep
|
deriveJSON defaultOptions ''RadarSweep
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.RightButtonOptions where
|
module Dodge.Data.RightButtonOptions where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -21,6 +22,7 @@ data RightButtonOptions
|
|||||||
, _opActivateEquipment :: ActivateEquipment
|
, _opActivateEquipment :: ActivateEquipment
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary RightButtonOptions
|
||||||
|
|
||||||
data ActivateEquipment
|
data ActivateEquipment
|
||||||
= ActivateEquipment {_activateEquipment :: Int}
|
= ActivateEquipment {_activateEquipment :: Int}
|
||||||
@@ -28,6 +30,7 @@ data ActivateEquipment
|
|||||||
| ActivateDeactivateEquipment {_activateEquipment :: Int, _deactivateEquipment :: Int}
|
| ActivateDeactivateEquipment {_activateEquipment :: Int, _deactivateEquipment :: Int}
|
||||||
| NoChangeActivateEquipment
|
| NoChangeActivateEquipment
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ActivateEquipment
|
||||||
|
|
||||||
data AllocateEquipment
|
data AllocateEquipment
|
||||||
= DoNotMoveEquipment
|
= DoNotMoveEquipment
|
||||||
@@ -51,6 +54,7 @@ data AllocateEquipment
|
|||||||
{ _allocOldPos :: EquipPosition
|
{ _allocOldPos :: EquipPosition
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary AllocateEquipment
|
||||||
|
|
||||||
makeLenses ''RightButtonOptions
|
makeLenses ''RightButtonOptions
|
||||||
makeLenses ''AllocateEquipment
|
makeLenses ''AllocateEquipment
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
{-# LANGUAGE TemplateHaskell #-}
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
|
|
||||||
module Dodge.Data.SaveSlot where
|
module Dodge.Data.SaveSlot where
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
|
|
||||||
@@ -12,5 +13,6 @@ data SaveSlot
|
|||||||
| LevelStartSlot Int
|
| LevelStartSlot Int
|
||||||
| SaveSlotNum Int
|
| SaveSlotNum Int
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary SaveSlot
|
||||||
|
|
||||||
makeLenses ''SaveSlot
|
makeLenses ''SaveSlot
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Shockwave where
|
module Dodge.Data.Shockwave where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -14,6 +15,7 @@ import Geometry.Data
|
|||||||
|
|
||||||
data ShockwaveDirection = OutwardShockwave | InwardShockwave
|
data ShockwaveDirection = OutwardShockwave | InwardShockwave
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ShockwaveDirection
|
||||||
|
|
||||||
data Shockwave = Shockwave
|
data Shockwave = Shockwave
|
||||||
{ _swColor :: Color
|
{ _swColor :: Color
|
||||||
@@ -27,6 +29,7 @@ data Shockwave = Shockwave
|
|||||||
, _swTimer :: Int
|
, _swTimer :: Int
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Shockwave
|
||||||
|
|
||||||
makeLenses ''Shockwave
|
makeLenses ''Shockwave
|
||||||
deriveJSON defaultOptions ''ShockwaveDirection
|
deriveJSON defaultOptions ''ShockwaveDirection
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.SoundOrigin where
|
module Dodge.Data.SoundOrigin where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
@@ -37,6 +38,7 @@ data SoundOrigin
|
|||||||
| Explosion Int
|
| Explosion Int
|
||||||
| Tap Int
|
| Tap Int
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary SoundOrigin
|
||||||
|
|
||||||
instance ToJSONKey SoundOrigin
|
instance ToJSONKey SoundOrigin
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Spark where
|
module Dodge.Data.Spark where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Color
|
import Color
|
||||||
@@ -23,6 +24,7 @@ data Spark = Spark
|
|||||||
, _skDamageType :: DamageType
|
, _skDamageType :: DamageType
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Spark
|
||||||
|
|
||||||
makeLenses ''Spark
|
makeLenses ''Spark
|
||||||
deriveJSON defaultOptions ''Spark
|
deriveJSON defaultOptions ''Spark
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Terminal where
|
module Dodge.Data.Terminal where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Color
|
import Color
|
||||||
@@ -17,6 +18,7 @@ import Dodge.Data.WorldEffect
|
|||||||
|
|
||||||
data TerminalStatus = TerminalOff | TerminalBusy | TerminalReady
|
data TerminalStatus = TerminalOff | TerminalBusy | TerminalReady
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary TerminalStatus
|
||||||
|
|
||||||
data TerminalInput = TerminalInput
|
data TerminalInput = TerminalInput
|
||||||
{ _tiText :: T.Text
|
{ _tiText :: T.Text
|
||||||
@@ -24,12 +26,14 @@ data TerminalInput = TerminalInput
|
|||||||
, _tiSel :: (Int, Int)
|
, _tiSel :: (Int, Int)
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary TerminalInput
|
||||||
|
|
||||||
data TerminalBootProgram
|
data TerminalBootProgram
|
||||||
= TerminalBootMempty
|
= TerminalBootMempty
|
||||||
| TerminalBootLines [TerminalLine]
|
| TerminalBootLines [TerminalLine]
|
||||||
deriving (Eq, Show, Read, Generic)
|
deriving (Eq, Show, Read, Generic)
|
||||||
--hderiving (Eq, Show, Read, Generic, Flat)
|
--hderiving (Eq, Show, Read, Generic, Flat)
|
||||||
|
--instance Binary TerminalBootProgram
|
||||||
|
|
||||||
data Terminal = Terminal
|
data Terminal = Terminal
|
||||||
{ _tmID :: Int
|
{ _tmID :: Int
|
||||||
@@ -51,15 +55,18 @@ data Terminal = Terminal
|
|||||||
}
|
}
|
||||||
deriving (Eq, Show, Read, Generic)
|
deriving (Eq, Show, Read, Generic)
|
||||||
--hderiving (Eq, Show, Read, Generic, Flat)
|
--hderiving (Eq, Show, Read, Generic, Flat)
|
||||||
|
--instance Binary Terminal
|
||||||
|
|
||||||
data TerminalLineString = TerminalLineConst String Color
|
data TerminalLineString = TerminalLineConst String Color
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary TerminalLineString
|
||||||
|
|
||||||
data TmTm
|
data TmTm
|
||||||
= TmId
|
= TmId
|
||||||
| TmTmClearDisplayedLines
|
| TmTmClearDisplayedLines
|
||||||
| TmTmSetStatus TerminalStatus
|
| TmTmSetStatus TerminalStatus
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary TmTm
|
||||||
|
|
||||||
data TerminalLine
|
data TerminalLine
|
||||||
= TerminalLineDisplay
|
= TerminalLineDisplay
|
||||||
@@ -76,18 +83,21 @@ data TerminalLine
|
|||||||
}
|
}
|
||||||
deriving (Eq, Show, Read, Generic)
|
deriving (Eq, Show, Read, Generic)
|
||||||
--hderiving (Eq, Show, Read, Generic, Flat)
|
--hderiving (Eq, Show, Read, Generic, Flat)
|
||||||
|
--instance Binary TerminalLine
|
||||||
|
|
||||||
data TerminalToggle = TerminalToggle
|
data TerminalToggle = TerminalToggle
|
||||||
{ _ttTriggerID :: Int
|
{ _ttTriggerID :: Int
|
||||||
, _ttDeathEffect :: BlBl
|
, _ttDeathEffect :: BlBl
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary TerminalToggle
|
||||||
|
|
||||||
data BlBl
|
data BlBl
|
||||||
= BlNegate
|
= BlNegate
|
||||||
| BlConst Bool
|
| BlConst Bool
|
||||||
| BlId
|
| BlId
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary BlBl
|
||||||
|
|
||||||
data EffectArguments
|
data EffectArguments
|
||||||
= NoArguments {_cmdEffect :: [TerminalLine]}
|
= NoArguments {_cmdEffect :: [TerminalLine]}
|
||||||
@@ -97,6 +107,7 @@ data EffectArguments
|
|||||||
}
|
}
|
||||||
deriving (Eq, Show, Read, Generic)
|
deriving (Eq, Show, Read, Generic)
|
||||||
--hderiving (Eq, Show, Read, Generic, Flat)
|
--hderiving (Eq, Show, Read, Generic, Flat)
|
||||||
|
--instance Binary EffectArguments
|
||||||
|
|
||||||
data TerminalCommandEffect
|
data TerminalCommandEffect
|
||||||
= TerminalCommandArguments EffectArguments
|
= TerminalCommandArguments EffectArguments
|
||||||
@@ -110,6 +121,7 @@ data TerminalCommandEffect
|
|||||||
| TerminalCommandEffectNone
|
| TerminalCommandEffectNone
|
||||||
deriving (Eq, Show, Read, Generic)
|
deriving (Eq, Show, Read, Generic)
|
||||||
--hderiving (Eq, Show, Read, Generic, Flat)
|
--hderiving (Eq, Show, Read, Generic, Flat)
|
||||||
|
--instance Binary TerminalCommandEffect
|
||||||
|
|
||||||
data TerminalCommand = TerminalCommand
|
data TerminalCommand = TerminalCommand
|
||||||
{ _tcString :: String
|
{ _tcString :: String
|
||||||
@@ -119,6 +131,7 @@ data TerminalCommand = TerminalCommand
|
|||||||
}
|
}
|
||||||
deriving (Eq, Show, Read, Generic)
|
deriving (Eq, Show, Read, Generic)
|
||||||
--hderiving (Eq, Show, Read, Generic, Flat)
|
--hderiving (Eq, Show, Read, Generic, Flat)
|
||||||
|
--instance Binary TerminalCommand
|
||||||
|
|
||||||
makeLenses ''TerminalInput
|
makeLenses ''TerminalInput
|
||||||
makeLenses ''Terminal
|
makeLenses ''Terminal
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.TeslaArc where
|
module Dodge.Data.TeslaArc where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Color
|
import Color
|
||||||
@@ -21,6 +22,7 @@ data TeslaArc = TeslaArc
|
|||||||
, _taColor :: Color
|
, _taColor :: Color
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary TeslaArc
|
||||||
|
|
||||||
makeLenses ''TeslaArc
|
makeLenses ''TeslaArc
|
||||||
deriveJSON defaultOptions ''TeslaArc
|
deriveJSON defaultOptions ''TeslaArc
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.TractorBeam where
|
module Dodge.Data.TractorBeam where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -19,6 +20,7 @@ data TractorBeam = TractorBeam
|
|||||||
, _tbTime :: Int
|
, _tbTime :: Int
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary TractorBeam
|
||||||
|
|
||||||
makeLenses ''TractorBeam
|
makeLenses ''TractorBeam
|
||||||
deriveJSON defaultOptions ''TractorBeam
|
deriveJSON defaultOptions ''TractorBeam
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ module Dodge.Data.Universe (
|
|||||||
module Picture.Data,
|
module Picture.Data,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
--import qualified Data.Map.Strict as M
|
--import qualified Data.Map.Strict as M
|
||||||
@@ -42,6 +43,7 @@ data ConcEffect = NoConcEffect
|
|||||||
|
|
||||||
data OptionScreenFlag = NormalOptions | GameOverOptions | SplashOptions
|
data OptionScreenFlag = NormalOptions | GameOverOptions | SplashOptions
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary OptionScreenFlag
|
||||||
|
|
||||||
data ScreenLayer
|
data ScreenLayer
|
||||||
= OptionScreen
|
= OptionScreen
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ module Dodge.Data.Wall (
|
|||||||
module Dodge.Data.Material,
|
module Dodge.Data.Material,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Color
|
import Color
|
||||||
@@ -37,6 +38,7 @@ data Wall = Wall
|
|||||||
, _wlMaterial :: Material
|
, _wlMaterial :: Material
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Wall
|
||||||
|
|
||||||
data Opacity
|
data Opacity
|
||||||
= SeeThrough
|
= SeeThrough
|
||||||
@@ -44,9 +46,11 @@ data Opacity
|
|||||||
| DrawnWall {_opDraw :: WallDraw} -- Wall -> SPic
|
| DrawnWall {_opDraw :: WallDraw} -- Wall -> SPic
|
||||||
| Opaque
|
| Opaque
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Opacity
|
||||||
|
|
||||||
data WallDraw = DrawForceField
|
data WallDraw = DrawForceField
|
||||||
deriving (Eq, Ord, Show, Read, Enum, Bounded, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Enum, Bounded, Generic, Flat)
|
||||||
|
instance Binary WallDraw
|
||||||
|
|
||||||
data WallStructure
|
data WallStructure
|
||||||
= StandaloneWall
|
= StandaloneWall
|
||||||
@@ -57,6 +61,7 @@ data WallStructure
|
|||||||
{ _wlStCreature :: Int
|
{ _wlStCreature :: Int
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary WallStructure
|
||||||
|
|
||||||
makeLenses ''Wall
|
makeLenses ''Wall
|
||||||
makeLenses ''Opacity
|
makeLenses ''Opacity
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ module Dodge.Data.World (
|
|||||||
module Dodge.Data.Hammer,
|
module Dodge.Data.Hammer,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Dodge.Data.SaveSlot
|
import Dodge.Data.SaveSlot
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -53,6 +54,7 @@ data TimeFlowStatus
|
|||||||
| RewindingLastFrame
|
| RewindingLastFrame
|
||||||
| NormalTimeFlow
|
| NormalTimeFlow
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary TimeFlowStatus
|
||||||
|
|
||||||
data WorldHammer
|
data WorldHammer
|
||||||
= SubInvHam
|
= SubInvHam
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.WorldEffect where
|
module Dodge.Data.WorldEffect where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
@@ -18,6 +19,7 @@ data ItCrWdWd
|
|||||||
= ItCrWdId
|
= ItCrWdId
|
||||||
| ItCrWdItemEffect
|
| ItCrWdItemEffect
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ItCrWdWd
|
||||||
|
|
||||||
data WdWd
|
data WdWd
|
||||||
= NoWorldEffect
|
= NoWorldEffect
|
||||||
@@ -34,11 +36,13 @@ data WdWd
|
|||||||
| WdWdFromItCrixWdWd Item Int ItCrWdWd
|
| WdWdFromItCrixWdWd Item Int ItCrWdWd
|
||||||
deriving (Eq, Show, Read, Generic)
|
deriving (Eq, Show, Read, Generic)
|
||||||
--hderiving (Eq, Show, Read, Generic, Flat)
|
--hderiving (Eq, Show, Read, Generic, Flat)
|
||||||
|
--instance Binary WdWd
|
||||||
|
|
||||||
data WdP2
|
data WdP2
|
||||||
= WdP2Const Point2
|
= WdP2Const Point2
|
||||||
| WdYouPos
|
| WdYouPos
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary WdP2
|
||||||
|
|
||||||
data MdWdWd
|
data MdWdWd
|
||||||
= MdWdId
|
= MdWdId
|
||||||
@@ -46,6 +50,7 @@ data MdWdWd
|
|||||||
| MdSetLSCol Point3
|
| MdSetLSCol Point3
|
||||||
| MdFlickerUpdate
|
| MdFlickerUpdate
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary MdWdWd
|
||||||
|
|
||||||
data WdBl
|
data WdBl
|
||||||
= WdTrig Int
|
= WdTrig Int
|
||||||
@@ -56,11 +61,13 @@ data WdBl
|
|||||||
| WdBlBtOn Int
|
| WdBlBtOn Int
|
||||||
| WdBlBtNotOff Int
|
| WdBlBtNotOff Int
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary WdBl
|
||||||
|
|
||||||
data WdP2f
|
data WdP2f
|
||||||
= WdP2f0
|
= WdP2f0
|
||||||
| WdP2fDoorPosition Int
|
| WdP2fDoorPosition Int
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary WdP2f
|
||||||
|
|
||||||
data DrWdWd
|
data DrWdWd
|
||||||
= DrWdId
|
= DrWdId
|
||||||
@@ -68,6 +75,7 @@ data DrWdWd
|
|||||||
| DrWdMechanismStepwise Int [Int] [(Point2, Point2)]
|
| DrWdMechanismStepwise Int [Int] [(Point2, Point2)]
|
||||||
| DoorMechanism
|
| DoorMechanism
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary DrWdWd
|
||||||
|
|
||||||
data TmWdWd
|
data TmWdWd
|
||||||
= TmWdId
|
= TmWdId
|
||||||
@@ -77,6 +85,7 @@ data TmWdWd
|
|||||||
| TmWdWdDoDeathTriggers
|
| TmWdWdDoDeathTriggers
|
||||||
deriving (Eq, Show, Read, Generic)
|
deriving (Eq, Show, Read, Generic)
|
||||||
--hderiving (Eq, Show, Read, Generic, Flat)
|
--hderiving (Eq, Show, Read, Generic, Flat)
|
||||||
|
--instance Binary TmWdWd
|
||||||
|
|
||||||
deriveJSON defaultOptions ''ItCrWdWd
|
deriveJSON defaultOptions ''ItCrWdWd
|
||||||
deriveJSON defaultOptions ''WdWd
|
deriveJSON defaultOptions ''WdWd
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
-- | GameRooms contain information about given positions in the world
|
-- | GameRooms contain information about given positions in the world
|
||||||
module Dodge.GameRoom where
|
module Dodge.GameRoom where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -23,6 +24,7 @@ data GameRoom = GameRoom
|
|||||||
, _grName :: String
|
, _grName :: String
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary GameRoom
|
||||||
|
|
||||||
instance ToJSON GameRoom where
|
instance ToJSON GameRoom where
|
||||||
toEncoding = genericToEncoding defaultOptions
|
toEncoding = genericToEncoding defaultOptions
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ module Dodge.Save (
|
|||||||
fromJSONSaveSlot,
|
fromJSONSaveSlot,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Dodge.Concurrent
|
import Dodge.Concurrent
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ module Geometry.ConvexPoly (
|
|||||||
|
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
import Geometry.Intersect
|
import Geometry.Intersect
|
||||||
@@ -31,6 +32,7 @@ data ConvexPoly = ConvexPoly
|
|||||||
, _cpRad :: Float
|
, _cpRad :: Float
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ConvexPoly
|
||||||
|
|
||||||
instance ToJSON ConvexPoly where
|
instance ToJSON ConvexPoly where
|
||||||
toEncoding = genericToEncoding defaultOptions
|
toEncoding = genericToEncoding defaultOptions
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ module IntSetHelp (
|
|||||||
|
|
||||||
import Data.IntSet.Internal
|
import Data.IntSet.Internal
|
||||||
import Data.IntSet
|
import Data.IntSet
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
|
|
||||||
-- IntSet is not an instance of Generic?!
|
-- IntSet is not an instance of Generic?!
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
{-# OPTIONS_GHC -fno-warn-orphans #-}
|
{-# OPTIONS_GHC -fno-warn-orphans #-}
|
||||||
module LinearHelp where
|
module LinearHelp where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Linear.V2
|
import Linear.V2
|
||||||
import Linear.V3
|
import Linear.V3
|
||||||
|
|||||||
@@ -8,10 +8,12 @@ module MaybeHelp where
|
|||||||
|
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
|
|
||||||
data Maybe' a = Just' {__Just' :: a} | Nothing'
|
data Maybe' a = Just' {__Just' :: a} | Nothing'
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance (Binary a => Binary (Maybe' a))
|
||||||
|
|
||||||
instance ToJSON a => ToJSON (Maybe' a) where
|
instance ToJSON a => ToJSON (Maybe' a) where
|
||||||
toEncoding = genericToEncoding defaultOptions
|
toEncoding = genericToEncoding defaultOptions
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Picture.Data where
|
module Picture.Data where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -21,6 +22,7 @@ data Verx = Verx
|
|||||||
, _vxShadNum :: !ShadNum
|
, _vxShadNum :: !ShadNum
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Verx
|
||||||
|
|
||||||
data Layer
|
data Layer
|
||||||
= BottomLayer
|
= BottomLayer
|
||||||
@@ -30,6 +32,7 @@ data Layer
|
|||||||
| DebugLayer
|
| DebugLayer
|
||||||
| FixedCoordLayer
|
| FixedCoordLayer
|
||||||
deriving (Eq, Ord, Enum, Bounded, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Enum, Bounded, Show, Read, Generic, Flat)
|
||||||
|
instance Binary Layer
|
||||||
|
|
||||||
layerNum :: Layer -> Int
|
layerNum :: Layer -> Int
|
||||||
layerNum = fromEnum
|
layerNum = fromEnum
|
||||||
@@ -39,6 +42,7 @@ numLayers = length [minBound :: Layer .. maxBound]
|
|||||||
|
|
||||||
newtype ShadNum = ShadNum {_unShadNum :: Int}
|
newtype ShadNum = ShadNum {_unShadNum :: Int}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ShadNum
|
||||||
|
|
||||||
polyNum, polyzNum, bezNum, textNum, arcNum, ellNum :: ShadNum
|
polyNum, polyzNum, bezNum, textNum, arcNum, ellNum :: ShadNum
|
||||||
{-# INLINE polyNum #-}
|
{-# INLINE polyNum #-}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ module Quaternion (
|
|||||||
) where
|
) where
|
||||||
|
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
import Geometry.Vector3D
|
import Geometry.Vector3D
|
||||||
|
|||||||
@@ -8,8 +8,10 @@
|
|||||||
|
|
||||||
module Shape.Data where
|
module Shape.Data where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
@@ -30,6 +32,7 @@ data ShapeObj = ShapeObj
|
|||||||
, _shVs :: [ShapeV]
|
, _shVs :: [ShapeV]
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ShapeObj
|
||||||
|
|
||||||
instance ToJSON ShapeObj where
|
instance ToJSON ShapeObj where
|
||||||
toEncoding = genericToEncoding defaultOptions
|
toEncoding = genericToEncoding defaultOptions
|
||||||
@@ -41,6 +44,8 @@ newtype ShapeType = TopPrism Int
|
|||||||
deriving stock Generic
|
deriving stock Generic
|
||||||
deriving anyclass Flat
|
deriving anyclass Flat
|
||||||
|
|
||||||
|
instance Binary ShapeType
|
||||||
|
|
||||||
instance ToJSON ShapeType where
|
instance ToJSON ShapeType where
|
||||||
toEncoding = genericToEncoding defaultOptions
|
toEncoding = genericToEncoding defaultOptions
|
||||||
|
|
||||||
@@ -52,6 +57,7 @@ data ShapeV = ShapeV
|
|||||||
, _svCol :: Point4
|
, _svCol :: Point4
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary ShapeV
|
||||||
|
|
||||||
instance ToJSON ShapeV where
|
instance ToJSON ShapeV where
|
||||||
toEncoding = genericToEncoding defaultOptions
|
toEncoding = genericToEncoding defaultOptions
|
||||||
|
|||||||
+3
-1
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Sound.Data where
|
module Sound.Data where
|
||||||
|
|
||||||
|
import Data.Binary
|
||||||
import Flat
|
import Flat
|
||||||
import LinearHelp ()
|
import LinearHelp ()
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -29,10 +30,11 @@ data PlayStatus
|
|||||||
| ToStart
|
| ToStart
|
||||||
| ToContinueStart
|
| ToContinueStart
|
||||||
| ToStop
|
| ToStop
|
||||||
deriving (Eq, Ord, Show)
|
deriving (Eq, Ord, Show, Read, Generic)
|
||||||
|
|
||||||
newtype SoundID = SoundID {_getSoundID :: Int}
|
newtype SoundID = SoundID {_getSoundID :: Int}
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||||
|
instance Binary SoundID
|
||||||
|
|
||||||
newtype SoundData = SoundData
|
newtype SoundData = SoundData
|
||||||
{ _loadedChunks :: IM.IntMap Mix.Chunk
|
{ _loadedChunks :: IM.IntMap Mix.Chunk
|
||||||
|
|||||||
Reference in New Issue
Block a user