we need a possibility to remove a player

This commit is contained in:
Dennis Frieberg 2020-09-05 22:45:49 +02:00
parent 45222c1022
commit bbba794612

View file

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