Use new handier type synonyms from lib

This commit is contained in:
Tissevert 2019-10-17 12:12:51 +02:00
parent e11a899745
commit 5cccd05290

View file

@ -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