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.ID (ID(..), getID)
import Hanafuda.KoiKoi (PlayerID) import Hanafuda.KoiKoi (PlayerID)
import qualified Hanafuda.KoiKoi as KoiKoi ( 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 deriving instance Generic PlayerID
instance FromJSON PlayerID instance FromJSON PlayerID
@ -113,14 +114,14 @@ instance ToJSON KoiKoi.Yaku where
instance ToJSONKey KoiKoi.Yaku where instance ToJSONKey KoiKoi.Yaku where
toJSONKey = toJSONKeyText (Text.pack . show) toJSONKey = toJSONKeyText (Text.pack . show)
deriving instance Generic (Player KoiKoi.Score) deriving instance Generic KoiKoi.Player
instance FromJSON (Player KoiKoi.Score) instance FromJSON KoiKoi.Player
instance ToJSON (Player KoiKoi.Score) where instance ToJSON KoiKoi.Player where
toEncoding = genericToEncoding defaultOptions toEncoding = genericToEncoding defaultOptions
deriving instance Generic (Players KoiKoi.Score) deriving instance Generic KoiKoi.Players
instance FromJSON (Players KoiKoi.Score) instance FromJSON KoiKoi.Players
instance ToJSON (Players KoiKoi.Score) where instance ToJSON KoiKoi.Players where
toEncoding = genericToEncoding defaultOptions toEncoding = genericToEncoding defaultOptions
deriving instance Generic KoiKoi.Step deriving instance Generic KoiKoi.Step
@ -160,7 +161,7 @@ instance ToJSON PublicPlayer where
data PublicState = PublicState { data PublicState = PublicState {
mode :: KoiKoi.Mode mode :: KoiKoi.Mode
, scores :: Scores KoiKoi.Score , scores :: KoiKoi.Scores
, month :: Hanafuda.Flower , month :: Hanafuda.Flower
, players :: Map PlayerID PublicPlayer , players :: Map PlayerID PublicPlayer
, playing :: PlayerID , playing :: PlayerID