Add Binary instances

This commit is contained in:
2022-08-21 10:58:19 +01:00
parent 386a2b4732
commit 1ce7d4a72d
95 changed files with 345 additions and 3 deletions
+4
View File
@@ -10,6 +10,7 @@ module Dodge.Data.Door (
module Dodge.Data.WorldEffect,
) where
import Data.Binary
import Flat
import LinearHelp ()
import Control.Lens
@@ -23,12 +24,14 @@ import Geometry.Data
data DoorStatus = DoorOpen | DoorClosed | DoorHalfway | DoorInt Int
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary DoorStatus
data PushSource
= PushesItself
| PushedBy Int
| NotPushed
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary PushSource
data Door = Door
{ _drID :: Int
@@ -49,6 +52,7 @@ data Door = Door
, _drObstacleType :: EdgeObstacle
}
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary Door
makeLenses ''Door
deriveJSON defaultOptions ''DoorStatus