we need a possibility to remove a player
This commit is contained in:
parent
45222c1022
commit
bbba794612
1 changed files with 5 additions and 1 deletions
|
@ -17,6 +17,7 @@ module Data.TickLeiste
|
||||||
fromList,
|
fromList,
|
||||||
toMap,
|
toMap,
|
||||||
Tick (..),
|
Tick (..),
|
||||||
|
removePlayer,
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
|
|
||||||
|
@ -107,6 +108,10 @@ setPlayerTick p t tl@(TickLeiste l pl) = TickLeiste (insertPlayerToLeiste p t l'
|
||||||
ot <- getPlayerTick p tl
|
ot <- getPlayerTick p tl
|
||||||
return $ removePlayerFromLeiste p ot l
|
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
|
-- | convert the Tick[eiste to a list of 'Tick' and 'Player' list pairs. These list are ordered
|
||||||
toList :: TickLeiste -> [(Tick, [Player])]
|
toList :: TickLeiste -> [(Tick, [Player])]
|
||||||
toList (TickLeiste l _) = M.toAscList l
|
toList (TickLeiste l _) = M.toAscList l
|
||||||
|
@ -122,7 +127,6 @@ fromList = error "not implemented"
|
||||||
toMap :: TickLeiste -> M.Map Tick [Player]
|
toMap :: TickLeiste -> M.Map Tick [Player]
|
||||||
toMap = leiste
|
toMap = leiste
|
||||||
|
|
||||||
|
|
||||||
-- these are just internal helpers
|
-- these are just internal helpers
|
||||||
|
|
||||||
-- it removes a player from a specific tick, if the player
|
-- it removes a player from a specific tick, if the player
|
||||||
|
|
Loading…
Reference in a new issue