From bbba794612fee5b65cde4d746b70bd0a00443e7f Mon Sep 17 00:00:00 2001 From: Dennis Frieberg Date: Sat, 5 Sep 2020 22:45:49 +0200 Subject: [PATCH] we need a possibility to remove a player --- src/Data/TickLeiste.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Data/TickLeiste.hs b/src/Data/TickLeiste.hs index 62d66b9..020b8f4 100644 --- a/src/Data/TickLeiste.hs +++ b/src/Data/TickLeiste.hs @@ -17,6 +17,7 @@ module Data.TickLeiste fromList, toMap, Tick (..), + removePlayer, ) where @@ -107,6 +108,10 @@ setPlayerTick p t tl@(TickLeiste l pl) = TickLeiste (insertPlayerToLeiste p t l' ot <- getPlayerTick p tl return $ removePlayerFromLeiste p ot l +-- TODO +removePlayer :: Player -> TickLeiste -> TickLeiste +removePlayer = error "removePlayer not yet implemented (Franzi?)" + -- | convert the Tick[eiste to a list of 'Tick' and 'Player' list pairs. These list are ordered toList :: TickLeiste -> [(Tick, [Player])] toList (TickLeiste l _) = M.toAscList l @@ -122,7 +127,6 @@ fromList = error "not implemented" toMap :: TickLeiste -> M.Map Tick [Player] toMap = leiste - -- these are just internal helpers -- it removes a player from a specific tick, if the player