From 83a644e2ab42016850eb1326581a56425fb1ed32 Mon Sep 17 00:00:00 2001 From: Dennis Frieberg Date: Wed, 26 Aug 2020 16:13:38 +0200 Subject: [PATCH] changed Player type to UUID --- package.yaml | 1 + src/Data/TickLeiste.hs | 7 ++----- tickLeiste.cabal | 2 ++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.yaml b/package.yaml index f4951c6..2858e6b 100644 --- a/package.yaml +++ b/package.yaml @@ -23,6 +23,7 @@ dependencies: - base >= 4.7 && < 5 - text - containers +- uuid library: source-dirs: src diff --git a/src/Data/TickLeiste.hs b/src/Data/TickLeiste.hs index cede4aa..62d66b9 100644 --- a/src/Data/TickLeiste.hs +++ b/src/Data/TickLeiste.hs @@ -16,7 +16,6 @@ module Data.TickLeiste toList, fromList, toMap, - fromMap, Tick (..), ) where @@ -24,6 +23,7 @@ where import qualified Data.Map.Strict as M import Data.Maybe (fromMaybe) import qualified Data.Text as T +import qualified Data.UUID as U -- | A Tick is just a number data Tick = Abwarten | Bereithalten | Tick Int @@ -45,7 +45,7 @@ getTickValue (Tick n) = Just n getTickValue _ = Nothing -- | A Player has a name as identifier -type Player = T.Text +type Player = U.UUID -- | The TickLeiste consists of a List of Ticks and for each Tick a -- Queue of players, that play at that turn. @@ -122,9 +122,6 @@ fromList = error "not implemented" toMap :: TickLeiste -> M.Map Tick [Player] toMap = leiste --- TODO -fromMap :: M.Map Tick [Player] -> Maybe TickLeiste -fromMap = error "not implemented" -- these are just internal helpers diff --git a/tickLeiste.cabal b/tickLeiste.cabal index 50e7ef5..3fbcc3a 100644 --- a/tickLeiste.cabal +++ b/tickLeiste.cabal @@ -36,6 +36,7 @@ library base >=4.7 && <5 , containers , text + , uuid default-language: Haskell2010 test-suite tickLeiste-test @@ -51,4 +52,5 @@ test-suite tickLeiste-test , containers , text , tickLeiste + , uuid default-language: Haskell2010