add askgame query json instance

This commit is contained in:
2020-03-29 00:25:05 +01:00
parent 696c76887e
commit 9eb443638a
+2
View File
@@ -167,6 +167,8 @@ instance ToJSON Query where
object ["query" .= ("skat" :: String), "cards" .= cards, "bid" .= bid ] object ["query" .= ("skat" :: String), "cards" .= cards, "bid" .= bid ]
toJSON (CardsQuery cards) = toJSON (CardsQuery cards) =
object ["query" .= ("cards" :: String), "cards" .= cards ] object ["query" .= ("cards" :: String), "cards" .= cards ]
toJSON (AskGameQuery bid) =
object ["query" .= ("ask_game" :: String), "bid" .= bid]
instance FromJSON ChosenResponse where instance FromJSON ChosenResponse where
parseJSON = withObject "ChosenResponse" $ \v -> ChosenResponse parseJSON = withObject "ChosenResponse" $ \v -> ChosenResponse