Add GameIDs to PublicGame

This commit is contained in:
Tissevert 2019-12-27 17:55:14 +01:00
parent b62dc4ff28
commit c6352a9669

View file

@ -31,7 +31,7 @@ import Data.Text.Encoding (decodeUtf8, encodeUtf8)
import GHC.Generics (Generic) import GHC.Generics (Generic)
import qualified Hanafuda (Card(..), Flower(..), Pack, cardsOfPack, empty, packOfCards) import qualified Hanafuda (Card(..), Flower(..), Pack, cardsOfPack, empty, packOfCards)
import Hanafuda.ID (ID(..), IDType(..), Prefix(..)) import Hanafuda.ID (ID(..), IDType(..), Prefix(..))
import Hanafuda.KoiKoi (PlayerID) import Hanafuda.KoiKoi (GameID, PlayerID)
import qualified Hanafuda.KoiKoi as KoiKoi ( import qualified Hanafuda.KoiKoi as KoiKoi (
Action(..), Game(..), Mode(..), Move(..), Player(..), Players(..), PlayerTurn Action(..), Game(..), Mode(..), Move(..), Player(..), Players(..), PlayerTurn
, Score, Scores, Source(..), Step(..), Yaku(..) , Score, Scores, Source(..), Step(..), Yaku(..)
@ -181,7 +181,8 @@ instance ToJSON ByteString where
toEncoding = toEncoding . decodeUtf8 . B64.encode toEncoding = toEncoding . decodeUtf8 . B64.encode
data PublicGame = PublicGame { data PublicGame = PublicGame {
nonce :: ByteString gameID :: GameID
, nonce :: ByteString
, playerHand :: Hanafuda.Pack , playerHand :: Hanafuda.Pack
, private :: ByteString , private :: ByteString
, public :: PublicState , public :: PublicState