Attempt to make CWorld correct instance of Store
This commit is contained in:
+10
-8
@@ -3,6 +3,9 @@
|
||||
|
||||
module Sound.Data where
|
||||
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
import LinearHelp
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
@@ -18,8 +21,6 @@ data SoundStatus = SoundStatus
|
||||
}
|
||||
deriving (Eq, Ord, Show)
|
||||
|
||||
|
||||
|
||||
-- TODO make this more sensible (use product rather than union in some cases)
|
||||
data PlayStatus
|
||||
= JustStartedPlaying
|
||||
@@ -29,13 +30,9 @@ data PlayStatus
|
||||
| ToStop
|
||||
deriving (Eq, Ord, Show)
|
||||
|
||||
|
||||
|
||||
newtype SoundID = SoundID {_getSoundID :: Int}
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
|
||||
|
||||
newtype SoundData = SoundData
|
||||
{ _loadedChunks :: IM.IntMap Mix.Chunk
|
||||
}
|
||||
@@ -50,8 +47,6 @@ data ToPlaySound = ToPlaySound
|
||||
}
|
||||
deriving (Eq, Show)
|
||||
|
||||
|
||||
|
||||
data Sound = Sound
|
||||
{ _soundTime :: Maybe Int
|
||||
, _soundStatus :: SoundStatus
|
||||
@@ -72,3 +67,10 @@ deriveJSON defaultOptions ''SoundStatus
|
||||
deriveJSON defaultOptions ''PlayStatus
|
||||
deriveJSON defaultOptions ''SoundID
|
||||
deriveJSON defaultOptions ''ToPlaySound
|
||||
|
||||
{- FOURMOLU_DISABLE -}
|
||||
$($(derive [d| instance Deriving (Store SoundStatus) |]))
|
||||
$($(derive [d| instance Deriving (Store PlayStatus) |]))
|
||||
$($(derive [d| instance Deriving (Store SoundID) |]))
|
||||
$($(derive [d| instance Deriving (Store ToPlaySound) |]))
|
||||
{- FOURMOLU_ENABLE -}
|
||||
|
||||
Reference in New Issue
Block a user