Cleanup module pathing
This commit is contained in:
+21
-11
@@ -1,25 +1,35 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.ArcStep where
|
||||
import Dodge.Data.CrWlID
|
||||
import Geometry.Data
|
||||
|
||||
import Control.Lens
|
||||
import GHC.Generics
|
||||
import Data.Aeson
|
||||
import Dodge.Data.CrWlID
|
||||
import GHC.Generics
|
||||
import Geometry.Data
|
||||
|
||||
data ArcStep = ArcStep
|
||||
{ _asPos :: Point2
|
||||
, _asDir :: Float
|
||||
, _asObject :: CrWlID --Maybe (Either Creature Wall)
|
||||
}
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON ArcStep where
|
||||
deriving (Eq, Ord, Show, Read, Generic)
|
||||
|
||||
instance ToJSON ArcStep where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON ArcStep
|
||||
data NextArcStep = EndArc
|
||||
|
||||
instance FromJSON ArcStep
|
||||
|
||||
data NextArcStep
|
||||
= EndArc
|
||||
| DefaultArcStep
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON NextArcStep where
|
||||
deriving (Eq, Ord, Show, Read, Generic)
|
||||
|
||||
instance ToJSON NextArcStep where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON NextArcStep
|
||||
|
||||
instance FromJSON NextArcStep
|
||||
|
||||
makeLenses ''ArcStep
|
||||
|
||||
@@ -3,6 +3,47 @@
|
||||
|
||||
module Dodge.Data.CWorld (
|
||||
module Dodge.Data.CWorld,
|
||||
module Dodge.Data.Beam,
|
||||
module Dodge.Data.Block,
|
||||
module Dodge.Data.Bounds,
|
||||
module Dodge.Data.Bullet,
|
||||
module Dodge.Data.Button,
|
||||
module Dodge.Data.Cloud,
|
||||
module Dodge.Data.Corpse,
|
||||
module Dodge.Data.CrGroupParams,
|
||||
module Dodge.Data.Creature,
|
||||
module Dodge.Data.Damage,
|
||||
module Dodge.Data.Distortion,
|
||||
module Dodge.Data.Door,
|
||||
module Dodge.Data.EnergyBall,
|
||||
module Dodge.Data.Flame,
|
||||
module Dodge.Data.Flare,
|
||||
module Dodge.Data.FloorItem,
|
||||
module Dodge.Data.ForegroundShape,
|
||||
module Dodge.Data.GenParams,
|
||||
module Dodge.Data.Gust,
|
||||
module Dodge.Data.HUD,
|
||||
module Dodge.Data.Item,
|
||||
module Dodge.Data.Laser,
|
||||
module Dodge.Data.LightSource,
|
||||
module Dodge.Data.LinearShockwave,
|
||||
module Dodge.Data.Machine,
|
||||
module Dodge.Data.Magnet,
|
||||
module Dodge.Data.Modification,
|
||||
module Dodge.Data.PathGraph,
|
||||
module Dodge.Data.PosEvent,
|
||||
module Dodge.Data.PressPlate,
|
||||
module Dodge.Data.Projectile,
|
||||
module Dodge.Data.Prop,
|
||||
module Dodge.Data.RadarBlip,
|
||||
module Dodge.Data.RadarSweep,
|
||||
module Dodge.Data.Shockwave,
|
||||
module Dodge.Data.Spark,
|
||||
module Dodge.Data.Terminal,
|
||||
module Dodge.Data.TeslaArc,
|
||||
module Dodge.Data.TractorBeam,
|
||||
module Dodge.Data.Wall,
|
||||
module Dodge.Data.WorldEffect,
|
||||
) where
|
||||
|
||||
import Control.Lens
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.CrWlID where
|
||||
import GHC.Generics
|
||||
import Data.Aeson
|
||||
|
||||
import Control.Lens
|
||||
data CrWlID = CrID Int | WlID Int | NothingID -- TODO rewrite/remove this
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON CrWlID where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON CrWlID
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
|
||||
data CrWlID = CrID Int | WlID Int | NothingID -- TODO rewrite/remove this
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
makeLenses ''CrWlID
|
||||
deriveJSON defaultOptions ''CrWlID
|
||||
|
||||
@@ -9,6 +9,7 @@ module Dodge.Data.Creature (
|
||||
module Dodge.Data.Creature.Perception,
|
||||
module Dodge.Data.Creature.Memory,
|
||||
module Dodge.Data.Creature.Stance,
|
||||
module Dodge.Data.ActionPlan
|
||||
) where
|
||||
|
||||
import Control.Lens
|
||||
@@ -22,7 +23,6 @@ import Dodge.Data.Creature.Stance
|
||||
import Dodge.Data.Creature.State
|
||||
import Dodge.Data.Hammer
|
||||
import Dodge.Data.Item
|
||||
import Dodge.Data.LoadAction
|
||||
import Dodge.Data.Material
|
||||
import GHC.Generics
|
||||
import Geometry.Data
|
||||
|
||||
@@ -1,81 +1,76 @@
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.CreatureEffect where
|
||||
import GHC.Generics
|
||||
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
|
||||
data WdCrCr = NoCreatureEffect
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON WdCrCr where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON WdCrCr
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data CrWdImp = NoCrWdImp
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON CrWdImp where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON CrWdImp
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data CrWdWd = CrWdWdId
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON CrWdWd where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON CrWdWd
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data IntImp = NoIntImp
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON IntImp where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON IntImp
|
||||
data CrImp = NoCrImp
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data CrImp
|
||||
= NoCrImp
|
||||
| TurnTowardCr Float -- turn amount
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON CrImp where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON CrImp
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data P2Imp = P2ImpNo
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON P2Imp where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON P2Imp
|
||||
data WdCrBl = WdCrTrue
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data WdCrBl
|
||||
= WdCrTrue
|
||||
| WdCrBlfromCrBl CrBl
|
||||
| WdCrNegate WdCrBl
|
||||
| WdCrLOSTarget
|
||||
| WdCrSafeDistFromTarget Float
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON WdCrBl where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON WdCrBl
|
||||
data CrBl = CrCanShoot
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data CrBl
|
||||
= CrCanShoot
|
||||
| CrIsReloading
|
||||
| CrIsAiming
|
||||
| CrIsAnimate
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON CrBl where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON CrBl
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data MCrAc = MCrNoAction
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON MCrAc where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON MCrAc
|
||||
data CrAc = CrTurnAround
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data CrAc
|
||||
= CrTurnAround
|
||||
| CrFleeFromTarget
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON CrAc where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON CrAc
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data P2Ac = P2NoAction
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON P2Ac where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON P2Ac
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data MP2Ac = MP2NoAction
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON MP2Ac where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON MP2Ac
|
||||
data CrWdAc = CrWdBFSThenReturn Int
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data CrWdAc
|
||||
= CrWdBFSThenReturn Int
|
||||
| ChooseMovementSpreadGun
|
||||
| ChooseMovementLtAuto
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON CrWdAc where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON CrWdAc
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
deriveJSON defaultOptions ''WdCrCr
|
||||
deriveJSON defaultOptions ''CrWdImp
|
||||
deriveJSON defaultOptions ''CrWdWd
|
||||
deriveJSON defaultOptions ''IntImp
|
||||
deriveJSON defaultOptions ''CrImp
|
||||
deriveJSON defaultOptions ''P2Imp
|
||||
deriveJSON defaultOptions ''WdCrBl
|
||||
deriveJSON defaultOptions ''CrBl
|
||||
deriveJSON defaultOptions ''MCrAc
|
||||
deriveJSON defaultOptions ''CrAc
|
||||
deriveJSON defaultOptions ''P2Ac
|
||||
deriveJSON defaultOptions ''MP2Ac
|
||||
deriveJSON defaultOptions ''CrWdAc
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
module Dodge.Data.Gas where
|
||||
import GHC.Generics
|
||||
import Data.Aeson
|
||||
data GasCreate = CreatePoisonGas | CreateFlame
|
||||
deriving (Eq,Ord,Show,Enum,Bounded,Read,Generic)
|
||||
instance ToJSON GasCreate where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON GasCreate
|
||||
@@ -2,13 +2,17 @@
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.Item.Use.Consumption where
|
||||
module Dodge.Data.Item.Use.Consumption (
|
||||
module Dodge.Data.Item.Use.Consumption,
|
||||
module Dodge.Data.Item.Use.Consumption.Ammo,
|
||||
module Dodge.Data.Item.Use.Consumption.LoadAction,
|
||||
) where
|
||||
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import Dodge.Data.Ammo
|
||||
import Dodge.Data.LoadAction
|
||||
import Dodge.Data.Item.Use.Consumption.Ammo
|
||||
import Dodge.Data.Item.Use.Consumption.LoadAction
|
||||
|
||||
data HeldConsumption
|
||||
= LoadableAmmo
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.Ammo where
|
||||
module Dodge.Data.Item.Use.Consumption.Ammo (
|
||||
module Dodge.Data.Item.Use.Consumption.Ammo,
|
||||
module Dodge.Data.Bullet,
|
||||
module Dodge.Data.Payload,
|
||||
) where
|
||||
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import Dodge.Data.Bullet
|
||||
import Dodge.Data.Gas
|
||||
import Dodge.Data.Payload
|
||||
import Dodge.Data.Wall
|
||||
|
||||
@@ -50,9 +53,13 @@ data AmmoType
|
||||
| GenericAmmo
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data GasCreate = CreatePoisonGas | CreateFlame
|
||||
deriving (Eq, Ord, Show, Enum, Bounded, Read)
|
||||
|
||||
makeLenses ''ProjectileUpdate
|
||||
makeLenses ''AmmoType
|
||||
deriveJSON defaultOptions ''ProjectileDraw
|
||||
deriveJSON defaultOptions ''ProjectileCreate
|
||||
deriveJSON defaultOptions ''ProjectileUpdate
|
||||
deriveJSON defaultOptions ''AmmoType
|
||||
deriveJSON defaultOptions ''GasCreate
|
||||
@@ -0,0 +1,32 @@
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.Item.Use.Consumption.LoadAction where
|
||||
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import Dodge.Data.Hammer
|
||||
import Sound.Data
|
||||
|
||||
data LoadAction
|
||||
= LoadEject {_actionTime :: Int, _actionSound :: SoundID}
|
||||
| LoadInsert {_actionTime :: Int, _actionSound :: SoundID}
|
||||
| LoadAdd {_actionTime :: Int, _actionSound :: SoundID, _insertMax :: Int}
|
||||
| LoadPrime {_actionTime :: Int, _actionSound :: SoundID}
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data InvSel = InvSel {_iselPos :: Int, _iselAction :: InvSelAction}
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data InvSelAction
|
||||
= NoInvSelAction
|
||||
| ReloadAction {_actionProgress :: Int, _reloadAction :: LoadAction, _actionHammer :: HammerType}
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
makeLenses ''LoadAction
|
||||
makeLenses ''InvSel
|
||||
makeLenses ''InvSelAction
|
||||
deriveJSON defaultOptions ''LoadAction
|
||||
deriveJSON defaultOptions ''InvSel
|
||||
deriveJSON defaultOptions ''InvSelAction
|
||||
@@ -1,33 +0,0 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
module Dodge.Data.LoadAction where
|
||||
import GHC.Generics
|
||||
import Data.Aeson
|
||||
import Sound.Data
|
||||
import Dodge.Data.Hammer
|
||||
import Control.Lens
|
||||
data LoadAction
|
||||
= LoadEject {_actionTime :: Int, _actionSound :: SoundID}
|
||||
| LoadInsert {_actionTime :: Int, _actionSound :: SoundID}
|
||||
| LoadAdd {_actionTime :: Int, _actionSound :: SoundID, _insertMax :: Int }
|
||||
| LoadPrime {_actionTime :: Int, _actionSound :: SoundID}
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON LoadAction where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON LoadAction
|
||||
data InvSel = InvSel {_iselPos :: Int, _iselAction :: InvSelAction }
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON InvSel where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON InvSel
|
||||
data InvSelAction
|
||||
= NoInvSelAction
|
||||
| ReloadAction { _actionProgress :: Int, _reloadAction :: LoadAction, _actionHammer :: HammerType}
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON InvSelAction where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON InvSelAction
|
||||
makeLenses ''LoadAction
|
||||
makeLenses ''InvSel
|
||||
makeLenses ''InvSelAction
|
||||
+16
-24
@@ -1,21 +1,25 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.Machine where
|
||||
module Dodge.Data.Machine (
|
||||
module Dodge.Data.Machine,
|
||||
module Dodge.Data.Machine.Sensor,
|
||||
module Dodge.Data.Material,
|
||||
module Dodge.Data.ObjectType,
|
||||
) where
|
||||
|
||||
import Color
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import qualified Data.IntSet as IS
|
||||
import qualified Data.Map.Strict as M
|
||||
import Dodge.Data.Damage
|
||||
import Dodge.Data.GenParams
|
||||
import Dodge.Data.Item
|
||||
import Dodge.Data.Machine.Sensor
|
||||
import Dodge.Data.Material
|
||||
import Dodge.Data.Object
|
||||
import Dodge.Data.Sensor
|
||||
import GHC.Generics
|
||||
import Dodge.Data.ObjectType
|
||||
import Geometry.Data
|
||||
import Sound.Data
|
||||
|
||||
@@ -24,17 +28,12 @@ data MachineDraw
|
||||
| MachineDrawTerminal
|
||||
| MachineDrawTurret
|
||||
| MachineDrawDamageSensor Float (PaletteColor, DecorationShape)
|
||||
deriving (Eq, Ord, Show, Read, Generic)
|
||||
|
||||
instance ToJSON MachineDraw where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
|
||||
instance FromJSON MachineDraw
|
||||
deriving (Eq, Show, Read)
|
||||
|
||||
data Machine = Machine
|
||||
{ _mcID :: Int
|
||||
, _mcWallIDs :: IS.IntSet
|
||||
, _mcDraw :: MachineDraw --Machine -> SPic
|
||||
, _mcDraw :: MachineDraw
|
||||
, _mcMaterial :: Material
|
||||
, _mcPos :: Point2
|
||||
, _mcDir :: Float
|
||||
@@ -47,12 +46,7 @@ data Machine = Machine
|
||||
, _mcName :: String
|
||||
, _mcCloseSound :: Maybe SoundID
|
||||
}
|
||||
deriving (Eq, Show, Read, Generic)
|
||||
|
||||
instance ToJSON Machine where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
|
||||
instance FromJSON Machine
|
||||
deriving (Eq, Show, Read)
|
||||
|
||||
data MachineType
|
||||
= StaticMachine
|
||||
@@ -62,12 +56,10 @@ data MachineType
|
||||
, _tuFireTime :: Int
|
||||
, _tuMCrID :: Maybe Int
|
||||
}
|
||||
deriving (Eq, Show, Read, Generic)
|
||||
|
||||
instance ToJSON MachineType where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
|
||||
instance FromJSON MachineType
|
||||
deriving (Eq, Show, Read)
|
||||
|
||||
makeLenses ''Machine
|
||||
makeLenses ''MachineType
|
||||
deriveJSON defaultOptions ''MachineDraw
|
||||
deriveJSON defaultOptions ''Machine
|
||||
deriveJSON defaultOptions ''MachineType
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.Sensor where
|
||||
module Dodge.Data.Machine.Sensor where
|
||||
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
@@ -1,13 +1,14 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
module Dodge.Data.MountedObject
|
||||
where
|
||||
import GHC.Generics
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.MountedObject where
|
||||
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
|
||||
data MountedObject
|
||||
= MountedLS Int
|
||||
| MountedProp Int
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON MountedObject where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON MountedObject
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
deriveJSON defaultOptions ''MountedObject
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
module Dodge.Data.Object where
|
||||
import GHC.Generics
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.ObjectType where
|
||||
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
|
||||
data ObjectType
|
||||
= ObTerminal
|
||||
| ObCreature
|
||||
@@ -15,9 +18,10 @@ data ObjectType
|
||||
| ObProp
|
||||
| ObTrigger
|
||||
| ObItem
|
||||
deriving (Eq,Show,Ord,Read,Enum,Bounded,Generic)
|
||||
instance ToJSON ObjectType where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON ObjectType
|
||||
deriving (Eq, Show, Ord, Read, Enum, Bounded)
|
||||
|
||||
instance ToJSONKey ObjectType
|
||||
|
||||
instance FromJSONKey ObjectType
|
||||
|
||||
deriveJSON defaultOptions ''ObjectType
|
||||
@@ -1,11 +1,12 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
--{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.Payload where
|
||||
import GHC.Generics
|
||||
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
|
||||
data Payload = ExplosionPayload | DudPayload
|
||||
deriving (Show,Read,Eq,Ord,Enum,Bounded,Generic)
|
||||
instance ToJSON Payload where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON Payload
|
||||
deriving (Show, Read, Eq, Ord, Enum, Bounded)
|
||||
|
||||
deriveJSON defaultOptions ''Payload
|
||||
|
||||
@@ -5,7 +5,7 @@ module Dodge.Data.Projectile where
|
||||
import GHC.Generics
|
||||
import Data.Aeson
|
||||
import Dodge.Data.Payload
|
||||
import Dodge.Data.Ammo
|
||||
import Dodge.Data.Item.Use.Consumption.Ammo
|
||||
import Geometry.Data
|
||||
import Control.Lens
|
||||
--data ProjectileType = ShellType
|
||||
|
||||
+53
-55
@@ -1,55 +1,19 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
module Dodge.Data.Prop
|
||||
where
|
||||
import GHC.Generics
|
||||
import Data.Aeson
|
||||
import Dodge.Data.WorldEffect
|
||||
import Shape.Data
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.Prop where
|
||||
|
||||
import Color
|
||||
import qualified Quaternion as Q
|
||||
import Geometry.Data
|
||||
import ShapePicture.Data
|
||||
import Control.Lens
|
||||
data PropDraw = PropDrawSPic SPic
|
||||
| PropDrawMovingShapeCol Shape
|
||||
| PropDrawMovingShape PropDraw
|
||||
| PropDrawFlatTranslate PropDraw
|
||||
| PropDoubleLampCover Float
|
||||
| PropVerticalLampCover Float
|
||||
| PropLampCover Float
|
||||
| PropDrawToggle PropDraw
|
||||
| PropDrawGib Float
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON PropDraw where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON PropDraw
|
||||
data PropUpdate -- = UpdatePropZ
|
||||
= PropUpdateAnd PropUpdate PropUpdate
|
||||
-- | UpdateShapeProp
|
||||
| PropFallSmallBounceDamage
|
||||
| PropFallSmallBounce
|
||||
| PropUpdateId
|
||||
| PropRotate Float
|
||||
| PropSetToggleAnd WdBl PropUpdate
|
||||
| PropUpdates [PropUpdate]
|
||||
| PropUpdateLS Int PrWdLsLs -- Prop -> World -> LightSource -> LightSource
|
||||
| PropUpdatePosition WdP2f
|
||||
| PropUpdateWhen WdBl PropUpdate
|
||||
| PropUpdateIf WdBl PropUpdate PropUpdate
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON PropUpdate where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON PropUpdate
|
||||
data PrWdLsLs = PrWdLsId
|
||||
| PrWdLsSetPosition WdP2f Point3
|
||||
| PrWdLsSetColor Point3
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON PrWdLsLs where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON PrWdLsLs
|
||||
data Prop
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import Dodge.Data.WorldEffect
|
||||
import Geometry.Data
|
||||
import qualified Quaternion as Q
|
||||
import Shape.Data
|
||||
import ShapePicture.Data
|
||||
|
||||
data Prop
|
||||
= PropZ
|
||||
{ _prPos :: Point2
|
||||
, _prDraw :: PropDraw
|
||||
@@ -60,8 +24,8 @@ data Prop
|
||||
, _prPosZ :: Float
|
||||
, _prVelZ :: Float
|
||||
, _prTimer :: Int
|
||||
, _prQuat :: Q.Quaternion Float
|
||||
, _prQuatSpin :: Q.Quaternion Float
|
||||
, _prQuat :: Q.Quaternion Float
|
||||
, _prQuatSpin :: Q.Quaternion Float
|
||||
, _prColor :: Color
|
||||
}
|
||||
| ShapeProp
|
||||
@@ -72,8 +36,42 @@ data Prop
|
||||
, _prRot :: Float
|
||||
, _prToggle :: Bool
|
||||
}
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON Prop where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON Prop
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data PropDraw
|
||||
= PropDrawSPic SPic
|
||||
| PropDrawMovingShapeCol Shape
|
||||
| PropDrawMovingShape PropDraw
|
||||
| PropDrawFlatTranslate PropDraw
|
||||
| PropDoubleLampCover Float
|
||||
| PropVerticalLampCover Float
|
||||
| PropLampCover Float
|
||||
| PropDrawToggle PropDraw
|
||||
| PropDrawGib Float
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data PropUpdate
|
||||
= PropUpdateAnd PropUpdate PropUpdate
|
||||
| PropFallSmallBounceDamage
|
||||
| PropFallSmallBounce
|
||||
| PropUpdateId
|
||||
| PropRotate Float
|
||||
| PropSetToggleAnd WdBl PropUpdate
|
||||
| PropUpdates [PropUpdate]
|
||||
| PropUpdateLS Int PrWdLsLs
|
||||
| PropUpdatePosition WdP2f
|
||||
| PropUpdateWhen WdBl PropUpdate
|
||||
| PropUpdateIf WdBl PropUpdate PropUpdate
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data PrWdLsLs
|
||||
= PrWdLsId
|
||||
| PrWdLsSetPosition WdP2f Point3
|
||||
| PrWdLsSetColor Point3
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
makeLenses ''Prop
|
||||
deriveJSON defaultOptions ''PropDraw
|
||||
deriveJSON defaultOptions ''PropUpdate
|
||||
deriveJSON defaultOptions ''PrWdLsLs
|
||||
deriveJSON defaultOptions ''Prop
|
||||
|
||||
@@ -1,20 +1,24 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
module Dodge.Data.RadarSweep where
|
||||
import GHC.Generics
|
||||
import Data.Aeson
|
||||
import Dodge.Data.Object
|
||||
import Geometry.Data
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.RadarSweep (
|
||||
module Dodge.Data.RadarSweep,
|
||||
module Dodge.Data.ObjectType,
|
||||
) where
|
||||
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import Dodge.Data.ObjectType
|
||||
import Geometry.Data
|
||||
|
||||
data RadarSweep = RadarSweep
|
||||
{ _rsPos :: Point2
|
||||
, _rsRad :: Float
|
||||
{ _rsPos :: Point2
|
||||
, _rsRad :: Float
|
||||
, _rsObject :: ObjectType
|
||||
, _rsTimer :: Int
|
||||
, _rsTimer :: Int
|
||||
}
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON RadarSweep where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON RadarSweep
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
makeLenses ''RadarSweep
|
||||
deriveJSON defaultOptions ''RadarSweep
|
||||
|
||||
@@ -1,59 +1,70 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.RightButtonOptions where
|
||||
import GHC.Generics
|
||||
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Dodge.Data.Equipment.Misc
|
||||
import Control.Lens
|
||||
import GHC.Generics
|
||||
|
||||
data RightButtonOptions
|
||||
= NoRightButtonOptions
|
||||
| EquipOptions
|
||||
{_opEquip :: [EquipPosition]
|
||||
,_opSel :: Int
|
||||
,_opCurInvPos :: Int
|
||||
,_opAllocateEquipment :: AllocateEquipment
|
||||
,_opActivateEquipment :: ActivateEquipment
|
||||
| EquipOptions
|
||||
{ _opEquip :: [EquipPosition]
|
||||
, _opSel :: Int
|
||||
, _opCurInvPos :: Int
|
||||
, _opAllocateEquipment :: AllocateEquipment
|
||||
, _opActivateEquipment :: ActivateEquipment
|
||||
}
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
deriving (Eq, Ord, Show, Read, Generic)
|
||||
|
||||
instance ToJSON RightButtonOptions where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
|
||||
instance FromJSON RightButtonOptions
|
||||
|
||||
data ActivateEquipment
|
||||
= ActivateEquipment {_activateEquipment :: Int }
|
||||
= ActivateEquipment {_activateEquipment :: Int}
|
||||
| DeactivateEquipment {_deactivateEquipment :: Int}
|
||||
| ActivateDeactivateEquipment {_activateEquipment :: Int ,_deactivateEquipment :: Int}
|
||||
| ActivateDeactivateEquipment {_activateEquipment :: Int, _deactivateEquipment :: Int}
|
||||
| NoChangeActivateEquipment
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
deriving (Eq, Ord, Show, Read, Generic)
|
||||
|
||||
instance ToJSON ActivateEquipment where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
|
||||
instance FromJSON ActivateEquipment
|
||||
data AllocateEquipment
|
||||
|
||||
data AllocateEquipment
|
||||
= DoNotMoveEquipment
|
||||
| PutOnEquipment
|
||||
{ _allocNewPos :: EquipPosition
|
||||
}
|
||||
| MoveEquipment
|
||||
{ _allocNewPos :: EquipPosition
|
||||
, _allocOldPos :: EquipPosition
|
||||
{ _allocNewPos :: EquipPosition
|
||||
, _allocOldPos :: EquipPosition
|
||||
}
|
||||
| SwapEquipment
|
||||
{ _allocNewPos :: EquipPosition
|
||||
, _allocOldPos :: EquipPosition
|
||||
, _allocSwapID :: Int
|
||||
{ _allocNewPos :: EquipPosition
|
||||
, _allocOldPos :: EquipPosition
|
||||
, _allocSwapID :: Int
|
||||
}
|
||||
| ReplaceEquipment
|
||||
{ _allocNewPos :: EquipPosition
|
||||
{ _allocNewPos :: EquipPosition
|
||||
, _allocRemoveID :: Int
|
||||
}
|
||||
| RemoveEquipment
|
||||
{ _allocOldPos :: EquipPosition
|
||||
{ _allocOldPos :: EquipPosition
|
||||
}
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON AllocateEquipment where
|
||||
deriving (Eq, Ord, Show, Read, Generic)
|
||||
|
||||
instance ToJSON AllocateEquipment where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON AllocateEquipment
|
||||
|
||||
instance FromJSON AllocateEquipment
|
||||
|
||||
makeLenses ''RightButtonOptions
|
||||
makeLenses ''AllocateEquipment
|
||||
makeLenses ''ActivateEquipment
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
module Dodge.Data.SoundOrigin
|
||||
where
|
||||
import Dodge.Data.Material
|
||||
import GHC.Generics
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.SoundOrigin where
|
||||
|
||||
import Data.Aeson
|
||||
data SoundOrigin = InventorySound
|
||||
import Data.Aeson.TH
|
||||
import Dodge.Data.Material
|
||||
|
||||
data SoundOrigin
|
||||
= InventorySound
|
||||
| BackgroundSound
|
||||
| OnceSound
|
||||
| CrSound Int
|
||||
@@ -30,7 +33,10 @@ data SoundOrigin = InventorySound
|
||||
| LeverSound Int
|
||||
| Explosion Int
|
||||
| Tap Int
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON SoundOrigin where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON SoundOrigin
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
instance ToJSONKey SoundOrigin
|
||||
|
||||
instance FromJSONKey SoundOrigin
|
||||
|
||||
deriveJSON defaultOptions ''SoundOrigin
|
||||
|
||||
Reference in New Issue
Block a user