Add Store instances

This commit is contained in:
2022-08-21 12:21:05 +01:00
parent 1ce7d4a72d
commit dd62e30026
92 changed files with 465 additions and 255 deletions
+5 -3
View File
@@ -10,6 +10,8 @@ module Dodge.Data.Door (
module Dodge.Data.WorldEffect,
) where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import LinearHelp ()
@@ -24,14 +26,14 @@ import Geometry.Data
data DoorStatus = DoorOpen | DoorClosed | DoorHalfway | DoorInt Int
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary DoorStatus
$($(derive [d| instance Deriving (Store DoorStatus ) |]))
data PushSource
= PushesItself
| PushedBy Int
| NotPushed
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary PushSource
$($(derive [d| instance Deriving (Store PushSource) |]))
data Door = Door
{ _drID :: Int
@@ -52,7 +54,7 @@ data Door = Door
, _drObstacleType :: EdgeObstacle
}
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary Door
$($(derive [d| instance Deriving (Store Door ) |]))
makeLenses ''Door
deriveJSON defaultOptions ''DoorStatus