Add more deriving clauses

This commit is contained in:
2022-07-25 09:26:41 +01:00
parent c3a5b9d5be
commit d62e14cdb5
8 changed files with 22 additions and 13 deletions
+4 -6
View File
@@ -300,17 +300,15 @@ data World = World
, _rSelect :: Point2 , _rSelect :: Point2
} }
--deriving (Eq,Show,Read) --deriving (Eq,Show,Read)
data WorldHammer
= SubInvHam
| DoubleMouseHam
deriving (Eq,Ord,Show,Read,Enum,Bounded)
data TimeFlowStatus data TimeFlowStatus
= RewindingNow = RewindingNow
| RewindingLastFrame | RewindingLastFrame
| NormalTimeFlow | NormalTimeFlow
deriving (Eq,Ord,Show,Read) deriving (Eq,Ord,Show,Read)
data WorldHammer
= SubInvHam
| DoubleMouseHam
deriving (Eq,Ord,Show,Read,Enum,Bounded)
data SaveSlot = QuicksaveSlot | LevelStartSlot data SaveSlot = QuicksaveSlot | LevelStartSlot
deriving (Eq,Ord,Show,Read) deriving (Eq,Ord,Show,Read)
+1
View File
@@ -10,6 +10,7 @@ data Bounds = Bounds
, _bdMinY :: Float , _bdMinY :: Float
, _bdMaxY :: Float , _bdMaxY :: Float
} }
deriving (Eq,Ord,Show,Read)
defaultBounds :: Bounds defaultBounds :: Bounds
defaultBounds = Bounds 0 0 0 0 defaultBounds = Bounds 0 0 0 0
+5 -1
View File
@@ -10,6 +10,7 @@ import Color
data ButtonDraw = DefaultDrawButton Color data ButtonDraw = DefaultDrawButton Color
| DefaultDrawSwitch Color Color | DefaultDrawSwitch Color Color
| DrawNoButton | DrawNoButton
deriving (Eq,Ord,Show,Read)
data ButtonEvent = ButtonDoNothing data ButtonEvent = ButtonDoNothing
| ButtonPress | ButtonPress
{_bpState :: ButtonState {_bpState :: ButtonState
@@ -32,6 +33,7 @@ data ButtonEvent = ButtonDoNothing
,_boffEff :: WdWd ,_boffEff :: WdWd
} }
| ButtonAccessTerminal | ButtonAccessTerminal
deriving (Eq,Ord,Show,Read)
data Button = Button data Button = Button
{ _btPict :: ButtonDraw --Button -> SPic { _btPict :: ButtonDraw --Button -> SPic
@@ -45,6 +47,8 @@ data Button = Button
, _btName :: String , _btName :: String
, _btColor :: Color , _btColor :: Color
} }
deriving (Eq,Ord,Show,Read)
data ButtonState = BtOn | BtOff | BtNoLabel data ButtonState = BtOn | BtOff | BtNoLabel
deriving (Eq, Show) deriving (Eq,Ord,Show,Read)
makeLenses ''Button makeLenses ''Button
makeLenses ''ButtonEvent
+6 -3
View File
@@ -5,30 +5,33 @@ import Geometry
import Control.Lens import Control.Lens
data LightSourceDraw = DefaultLightSourceDraw data LightSourceDraw = DefaultLightSourceDraw
deriving (Eq,Ord,Show,Read)
data TLSIntensity = ConstantIntensity data TLSIntensity = ConstantIntensity
| TLSFade Point3 Int | TLSFade Point3 Int
deriving (Eq,Ord,Show,Read)
data TLSUpdate = DestroyTLS data TLSUpdate = DestroyTLS
| TimerTLS | TimerTLS
| IntensityTLS TLSIntensity | IntensityTLS TLSIntensity
deriving (Eq,Ord,Show,Read)
data LSParam = LSParam data LSParam = LSParam
{ _lsPos :: !Point3 { _lsPos :: !Point3
, _lsRad :: !Float , _lsRad :: !Float
, _lsCol :: !Point3 , _lsCol :: !Point3
} }
deriving (Eq,Ord,Show,Read)
data LightSource = LS data LightSource = LS
{ _lsID :: Int { _lsID :: Int
, _lsParam :: LSParam , _lsParam :: LSParam
, _lsDir :: Float , _lsDir :: Float
, _lsPict :: LightSourceDraw --LightSource -> Picture , _lsPict :: LightSourceDraw --LightSource -> Picture
} }
deriving (Eq,Ord,Show,Read)
data TempLightSource = TLS data TempLightSource = TLS
{ _tlsParam :: LSParam { _tlsParam :: LSParam
, _tlsUpdate :: TLSUpdate --TempLightSource -> Maybe TempLightSource , _tlsUpdate :: TLSUpdate --TempLightSource -> Maybe TempLightSource
, _tlsTime :: Int , _tlsTime :: Int
} }
deriving (Eq,Ord,Show,Read)
makeLenses ''LSParam makeLenses ''LSParam
makeLenses ''LightSource makeLenses ''LightSource
makeLenses ''TempLightSource makeLenses ''TempLightSource
+1
View File
@@ -22,4 +22,5 @@ data Modification
, _mdExternalID2 :: Int , _mdExternalID2 :: Int
, _mdUpdate :: MdWdWd , _mdUpdate :: MdWdWd
} }
deriving (Eq,Ord,Show,Read)
makeLenses ''Modification makeLenses ''Modification
+3
View File
@@ -13,11 +13,13 @@ data RightButtonOptions
,_opAllocateEquipment :: AllocateEquipment ,_opAllocateEquipment :: AllocateEquipment
,_opActivateEquipment :: ActivateEquipment ,_opActivateEquipment :: ActivateEquipment
} }
deriving (Eq,Ord,Show,Read)
data ActivateEquipment data ActivateEquipment
= ActivateEquipment {_activateEquipment :: Int } = ActivateEquipment {_activateEquipment :: Int }
| DeactivateEquipment {_deactivateEquipment :: Int} | DeactivateEquipment {_deactivateEquipment :: Int}
| ActivateDeactivateEquipment {_activateEquipment :: Int ,_deactivateEquipment :: Int} | ActivateDeactivateEquipment {_activateEquipment :: Int ,_deactivateEquipment :: Int}
| NoChangeActivateEquipment | NoChangeActivateEquipment
deriving (Eq,Ord,Show,Read)
data AllocateEquipment data AllocateEquipment
= DoNotMoveEquipment = DoNotMoveEquipment
| PutOnEquipment | PutOnEquipment
@@ -39,6 +41,7 @@ data AllocateEquipment
| RemoveEquipment | RemoveEquipment
{ _allocOldPos :: EquipPosition { _allocOldPos :: EquipPosition
} }
deriving (Eq,Ord,Show,Read)
makeLenses ''RightButtonOptions makeLenses ''RightButtonOptions
makeLenses ''AllocateEquipment makeLenses ''AllocateEquipment
makeLenses ''ActivateEquipment makeLenses ''ActivateEquipment
+1
View File
@@ -5,3 +5,4 @@ import Geometry
data Distortion data Distortion
= RadialDistortion Point2 Point2 Point2 Float = RadialDistortion Point2 Point2 Point2 Float
deriving (Eq,Ord,Show,Read)
-2
View File
@@ -3,8 +3,6 @@ import Dodge.Data
import Geometry import Geometry
import Color import Color
import LensHelp import LensHelp
import ShapePicture
import Shape
import Dodge.Default.Wall import Dodge.Default.Wall
import Dodge.Default.Block import Dodge.Default.Block