diff --git a/src/Hanafuda/Message.hs b/src/Hanafuda/Message.hs index dc01dcd..8dd83cc 100644 --- a/src/Hanafuda/Message.hs +++ b/src/Hanafuda/Message.hs @@ -7,7 +7,7 @@ module Hanafuda.Message ( T(..) , FromClient(..) - , GameState(..) + , Coordinates(..) , PrivateState(..) , PublicGame(..) , PublicPlayer(..) @@ -140,17 +140,18 @@ instance FromJSON Hanafuda.Flower instance ToJSON Hanafuda.Flower where toEncoding = genericToEncoding defaultOptions -data GameState = GameState { +data Coordinates = Coordinates { gameID :: GameID - , turns :: Int + , month :: Hanafuda.Flower + , turn :: Int } deriving (Eq, Generic, Show) -instance FromJSON GameState -instance ToJSON GameState where +instance FromJSON Coordinates +instance ToJSON Coordinates where toEncoding = genericToEncoding defaultOptions data PrivateState = PrivateState { - link :: GameState + link :: Coordinates , hands :: Map PlayerID Hanafuda.Pack , deck :: [Hanafuda.Card] } deriving Generic @@ -169,10 +170,9 @@ instance ToJSON PublicPlayer where toEncoding = genericToEncoding defaultOptions data PublicState = PublicState { - gameState :: GameState + coordinates :: Coordinates , mode :: KoiKoi.Mode , scores :: KoiKoi.Scores - , month :: Hanafuda.Flower , nextPlayer :: KoiKoi.PlayerTurn , players :: Map PlayerID PublicPlayer , playing :: PlayerID