Add generic derivations and To/FromJSON instances

This commit is contained in:
2022-07-25 22:49:18 +01:00
parent f5604ef429
commit b8e8413daa
99 changed files with 1406 additions and 517 deletions
+8 -2
View File
@@ -1,6 +1,10 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE StrictData #-}
module Dodge.Data.SoundOrigin
where
import Dodge.Data.Material
import GHC.Generics
import Data.Aeson
data SoundOrigin = InventorySound
| BackgroundSound
| OnceSound
@@ -26,5 +30,7 @@ data SoundOrigin = InventorySound
| LeverSound Int
| Explosion Int
| Tap Int
deriving (Eq,Ord,Show,Read)
deriving (Eq,Ord,Show,Read,Generic)
instance ToJSON SoundOrigin where
toEncoding = genericToEncoding defaultOptions
instance FromJSON SoundOrigin