Browse Source

add askgame query json instance

master
flavis 6 years ago
parent
commit
9eb443638a
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      src/Skat/AI/Online.hs

+ 2
- 0
src/Skat/AI/Online.hs View File

@@ -167,6 +167,8 @@ instance ToJSON Query where
object ["query" .= ("skat" :: String), "cards" .= cards, "bid" .= bid ]
toJSON (CardsQuery cards) =
object ["query" .= ("cards" :: String), "cards" .= cards ]
toJSON (AskGameQuery bid) =
object ["query" .= ("ask_game" :: String), "bid" .= bid]

instance FromJSON ChosenResponse where
parseJSON = withObject "ChosenResponse" $ \v -> ChosenResponse


Loading…
Cancel
Save