From 5cccd052908b5076ac1ecdd732e5e9e37127529e Mon Sep 17 00:00:00 2001 From: Tissevert Date: Thu, 17 Oct 2019 12:12:51 +0200 Subject: [PATCH] Use new handier type synonyms from lib --- src/Hanafuda/Message.hs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Hanafuda/Message.hs b/src/Hanafuda/Message.hs index c43e871..bcc6183 100644 --- a/src/Hanafuda/Message.hs +++ b/src/Hanafuda/Message.hs @@ -32,9 +32,10 @@ import qualified Hanafuda (Card(..), Flower(..), Pack, cardsOfPack, empty, packO import Hanafuda.ID (ID(..), getID) import Hanafuda.KoiKoi (PlayerID) import qualified Hanafuda.KoiKoi as KoiKoi ( - Action(..), Game(..), Mode(..), Move(..), Score, Source(..), Step(..), Yaku(..) + Action(..), Game(..), Mode(..), Move(..), Player(..), Players(..), Score + , Scores, Source(..), Step(..), Yaku(..) ) -import Hanafuda.Player (Player(..), Players(..), Scores) +import Hanafuda.Player (Player(..), Players(..)) deriving instance Generic PlayerID instance FromJSON PlayerID @@ -113,14 +114,14 @@ instance ToJSON KoiKoi.Yaku where instance ToJSONKey KoiKoi.Yaku where toJSONKey = toJSONKeyText (Text.pack . show) -deriving instance Generic (Player KoiKoi.Score) -instance FromJSON (Player KoiKoi.Score) -instance ToJSON (Player KoiKoi.Score) where +deriving instance Generic KoiKoi.Player +instance FromJSON KoiKoi.Player +instance ToJSON KoiKoi.Player where toEncoding = genericToEncoding defaultOptions -deriving instance Generic (Players KoiKoi.Score) -instance FromJSON (Players KoiKoi.Score) -instance ToJSON (Players KoiKoi.Score) where +deriving instance Generic KoiKoi.Players +instance FromJSON KoiKoi.Players +instance ToJSON KoiKoi.Players where toEncoding = genericToEncoding defaultOptions deriving instance Generic KoiKoi.Step @@ -160,7 +161,7 @@ instance ToJSON PublicPlayer where data PublicState = PublicState { mode :: KoiKoi.Mode - , scores :: Scores KoiKoi.Score + , scores :: KoiKoi.Scores , month :: Hanafuda.Flower , players :: Map PlayerID PublicPlayer , playing :: PlayerID