diff --git a/src/AI.hs b/src/AI.hs index 24ba50a..71740d6 100644 --- a/src/AI.hs +++ b/src/AI.hs @@ -13,10 +13,10 @@ import Hanafuda ( , cardsOf, cardsOfPack, contains, empty,flower, packOfCards, sameMonth, size, union ) import Hanafuda.Player (Player(..), Players(..)) -import Hanafuda.KoiKoi (GameBlueprint(..), Move(..), PlayerKey, Step(..), Score) +import Hanafuda.KoiKoi (GameBlueprint(..), Move(..), PlayerID, Step(..), Score) import Hanafuda.Message (PublicGame) -move :: PlayerKey -> PublicGame -> Move +move :: PlayerID -> PublicGame -> Move move me (Game {step = ToPlay, month, players = Players p, river}) = case getAvailableCards myHand (cardsOfPack river) of diff --git a/src/Automaton.hs b/src/Automaton.hs index 5fde440..3b71a01 100644 --- a/src/Automaton.hs +++ b/src/Automaton.hs @@ -15,7 +15,7 @@ import Control.Concurrent (threadDelay) import Control.Monad.Reader (ReaderT, ask) import Control.Monad.State (StateT) import Control.Monad.Trans (lift) -import Hanafuda.KoiKoi (Game, GameBlueprint(..), PlayerKey, Step(..)) +import Hanafuda.KoiKoi (Game, GameBlueprint(..), PlayerID, Step(..)) import qualified Hanafuda.Message as Message (T(..), FromClient(..), PublicGame) import Network.WebSockets (Connection, receiveData, sendTextData) import Prelude hiding (error, putStrLn) @@ -24,16 +24,16 @@ import System.Exit (exitSuccess) data State = Initial | Connected { - key :: PlayerKey + key :: PlayerID } | LoggedIn { - key :: PlayerKey + key :: PlayerID , name :: Text } | Playing { - key :: PlayerKey + key :: PlayerID , name :: Text - , against :: PlayerKey + , against :: PlayerID } deriving Show