changed Player type to UUID
This commit is contained in:
parent
e38b240178
commit
83a644e2ab
3 changed files with 5 additions and 5 deletions
|
@ -23,6 +23,7 @@ dependencies:
|
||||||
- base >= 4.7 && < 5
|
- base >= 4.7 && < 5
|
||||||
- text
|
- text
|
||||||
- containers
|
- containers
|
||||||
|
- uuid
|
||||||
|
|
||||||
library:
|
library:
|
||||||
source-dirs: src
|
source-dirs: src
|
||||||
|
|
|
@ -16,7 +16,6 @@ module Data.TickLeiste
|
||||||
toList,
|
toList,
|
||||||
fromList,
|
fromList,
|
||||||
toMap,
|
toMap,
|
||||||
fromMap,
|
|
||||||
Tick (..),
|
Tick (..),
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
|
@ -24,6 +23,7 @@ where
|
||||||
import qualified Data.Map.Strict as M
|
import qualified Data.Map.Strict as M
|
||||||
import Data.Maybe (fromMaybe)
|
import Data.Maybe (fromMaybe)
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
|
import qualified Data.UUID as U
|
||||||
|
|
||||||
-- | A Tick is just a number
|
-- | A Tick is just a number
|
||||||
data Tick = Abwarten | Bereithalten | Tick Int
|
data Tick = Abwarten | Bereithalten | Tick Int
|
||||||
|
@ -45,7 +45,7 @@ getTickValue (Tick n) = Just n
|
||||||
getTickValue _ = Nothing
|
getTickValue _ = Nothing
|
||||||
|
|
||||||
-- | A Player has a name as identifier
|
-- | 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
|
-- | The TickLeiste consists of a List of Ticks and for each Tick a
|
||||||
-- Queue of players, that play at that turn.
|
-- Queue of players, that play at that turn.
|
||||||
|
@ -122,9 +122,6 @@ fromList = error "not implemented"
|
||||||
toMap :: TickLeiste -> M.Map Tick [Player]
|
toMap :: TickLeiste -> M.Map Tick [Player]
|
||||||
toMap = leiste
|
toMap = leiste
|
||||||
|
|
||||||
-- TODO
|
|
||||||
fromMap :: M.Map Tick [Player] -> Maybe TickLeiste
|
|
||||||
fromMap = error "not implemented"
|
|
||||||
|
|
||||||
-- these are just internal helpers
|
-- these are just internal helpers
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ library
|
||||||
base >=4.7 && <5
|
base >=4.7 && <5
|
||||||
, containers
|
, containers
|
||||||
, text
|
, text
|
||||||
|
, uuid
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
|
||||||
test-suite tickLeiste-test
|
test-suite tickLeiste-test
|
||||||
|
@ -51,4 +52,5 @@ test-suite tickLeiste-test
|
||||||
, containers
|
, containers
|
||||||
, text
|
, text
|
||||||
, tickLeiste
|
, tickLeiste
|
||||||
|
, uuid
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
|
Loading…
Reference in a new issue