Unify Points type + export it with Score and Step types in module KoiKoi

This commit is contained in:
Sasha 2018-05-12 11:17:37 +02:00
parent 0c58e94c6f
commit 8ad996914d
4 changed files with 11 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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 {