From 8ad996914d99751f9fe390d64d7b7d698e902122 Mon Sep 17 00:00:00 2001 From: Sasha Date: Sat, 12 May 2018 11:17:37 +0200 Subject: [PATCH] Unify Points type + export it with Score and Step types in module KoiKoi --- ChangeLog.md | 5 +++++ hanafuda.cabal | 2 +- src/Hanafuda/KoiKoi.hs | 4 ++++ src/Hanafuda/KoiKoi/Yaku.hs | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 8bb2ec3..7d319df 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,10 @@ # Revision history for hanafuda +## 0.2.1.0 -- 2018-03-16 + +* Export some more types needed to export the game's state +* Unify the different types aliases for Points used in Player and Yaku + ## 0.2.0.0 -- 2018-03-16 * Restructured the project to expose only the cards, a parametric type for players, and a module to play KoiKoi diff --git a/hanafuda.cabal b/hanafuda.cabal index f7e2094..2e5b7cc 100644 --- a/hanafuda.cabal +++ b/hanafuda.cabal @@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: hanafuda -version: 0.2.0.0 +version: 0.2.1.0 synopsis: A game of Hanafuda (a family of japanese card games) description: This is a library to represent the cards and the players of games in this family. It also implements one such game diff --git a/src/Hanafuda/KoiKoi.hs b/src/Hanafuda/KoiKoi.hs index 1c18528..358e22b 100644 --- a/src/Hanafuda/KoiKoi.hs +++ b/src/Hanafuda/KoiKoi.hs @@ -6,12 +6,16 @@ module Hanafuda.KoiKoi ( , Move(..) , On(..) , Over(..) + , Score + , Step(..) + , Yaku(..) , new , play ) where import Hanafuda (Card(..), Flower(Pine), contains, flower, match, remove) import qualified Hanafuda.Player as Player (deal) +import Hanafuda.KoiKoi.Yaku (Yaku(..), Score) import Hanafuda.KoiKoi.Game (Game(..), Mode(..), Move(..), On(..), Over(..), Step(..), raise) import qualified Hanafuda.KoiKoi.Round as Round (deal, next) import qualified Hanafuda.KoiKoi.Turn as Turn (catch, end, next) diff --git a/src/Hanafuda/KoiKoi/Yaku.hs b/src/Hanafuda/KoiKoi/Yaku.hs index 9e24c6a..b2246a1 100644 --- a/src/Hanafuda/KoiKoi/Yaku.hs +++ b/src/Hanafuda/KoiKoi/Yaku.hs @@ -2,6 +2,7 @@ module Hanafuda.KoiKoi.Yaku where import Hanafuda (Card(..), Monthly, Pack, add, contains, intersection, packOfCards, size) +import Hanafuda.Player (Points) import qualified Data.Map as M (Map, empty, insert, unionWith, (!)) import qualified Data.Set as S (Set, empty, singleton, union) import Control.Monad.Reader (reader) @@ -19,7 +20,6 @@ data Yaku = | TsukiFuda deriving (Eq, Ord, Show) type YakuRater = Pack -> Maybe Points -type Points = Int type Score = M.Map Yaku Points data YakuFinder = YakuFinder {