Add Binary instances
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
module Dodge.Data.LightSource where
|
||||
|
||||
import Data.Binary
|
||||
import Flat
|
||||
import LinearHelp ()
|
||||
import Control.Lens
|
||||
@@ -14,17 +15,20 @@ import Geometry
|
||||
|
||||
data LightSourceDraw = DefaultLightSourceDraw
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary LightSourceDraw
|
||||
|
||||
data TLSIntensity
|
||||
= ConstantIntensity
|
||||
| TLSFade Point3 Int
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary TLSIntensity
|
||||
|
||||
data TLSUpdate
|
||||
= DestroyTLS
|
||||
| TimerTLS
|
||||
| IntensityTLS TLSIntensity
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary TLSUpdate
|
||||
|
||||
data LSParam = LSParam
|
||||
{ _lsPos :: !Point3
|
||||
@@ -32,6 +36,7 @@ data LSParam = LSParam
|
||||
, _lsCol :: !Point3
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary LSParam
|
||||
|
||||
data LightSource = LS
|
||||
{ _lsID :: Int
|
||||
@@ -40,6 +45,7 @@ data LightSource = LS
|
||||
, _lsPict :: LightSourceDraw --LightSource -> Picture
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary LightSource
|
||||
|
||||
data TempLightSource = TLS
|
||||
{ _tlsParam :: LSParam
|
||||
@@ -47,6 +53,7 @@ data TempLightSource = TLS
|
||||
, _tlsTime :: Int
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary TempLightSource
|
||||
|
||||
makeLenses ''LSParam
|
||||
makeLenses ''LightSource
|
||||
|
||||
Reference in New Issue
Block a user