added read instances
This commit is contained in:
parent
4af9f88b83
commit
da214ba266
2 changed files with 3 additions and 3 deletions
|
@ -22,7 +22,7 @@ data JSONRequest
|
||||||
| TickLeisteR
|
| TickLeisteR
|
||||||
| ChangeNameR {cnaRplayerUUID :: U.UUID, cnaRplayerName :: T.Text}
|
| ChangeNameR {cnaRplayerUUID :: U.UUID, cnaRplayerName :: T.Text}
|
||||||
| RemovePlayerR {rmpRplayerUUID :: U.UUID}
|
| RemovePlayerR {rmpRplayerUUID :: U.UUID}
|
||||||
deriving (Show,Eq)
|
deriving (Show, Eq, Read)
|
||||||
|
|
||||||
$(deriveJSON defaultOptions {sumEncoding = defaultTaggedObject {tagFieldName = "requestType"}, fieldLabelModifier = drop 4} ''JSONRequest)
|
$(deriveJSON defaultOptions {sumEncoding = defaultTaggedObject {tagFieldName = "requestType"}, fieldLabelModifier = drop 4} ''JSONRequest)
|
||||||
|
|
||||||
|
@ -32,6 +32,6 @@ data JSONEvent
|
||||||
| InitializeTickLeisteE {itlEtickLeiste :: [(Tick, [(U.UUID, T.Text)])]}
|
| InitializeTickLeisteE {itlEtickLeiste :: [(Tick, [(U.UUID, T.Text)])]}
|
||||||
| ChangeNameE {cnaEplayerUUID :: U.UUID, cnaEplayerName :: T.Text}
|
| ChangeNameE {cnaEplayerUUID :: U.UUID, cnaEplayerName :: T.Text}
|
||||||
| RemovePlayerE {rmpEplayerUUID :: U.UUID}
|
| RemovePlayerE {rmpEplayerUUID :: U.UUID}
|
||||||
deriving (Show,Eq)
|
deriving (Show, Eq, Read)
|
||||||
|
|
||||||
$(deriveJSON defaultOptions {sumEncoding = defaultTaggedObject {tagFieldName = "eventType"}, fieldLabelModifier = drop 4} ''JSONEvent)
|
$(deriveJSON defaultOptions {sumEncoding = defaultTaggedObject {tagFieldName = "eventType"}, fieldLabelModifier = drop 4} ''JSONEvent)
|
||||||
|
|
|
@ -28,7 +28,7 @@ import qualified Data.UUID as U
|
||||||
|
|
||||||
-- | A Tick is just a number
|
-- | A Tick is just a number
|
||||||
data Tick = Abwarten | Bereithalten | Tick Int
|
data Tick = Abwarten | Bereithalten | Tick Int
|
||||||
deriving (Show, Eq, Ord)
|
deriving (Show, Eq, Ord, Read)
|
||||||
|
|
||||||
-- | test if 'Tick' is constructed using 'Abwarten'
|
-- | test if 'Tick' is constructed using 'Abwarten'
|
||||||
isAbwarten :: Tick -> Bool
|
isAbwarten :: Tick -> Bool
|
||||||
|
|
Loading…
Reference in a new issue