--- a/gameServer/RoomsAndClients.hs Sat Aug 14 02:10:27 2010 +0200
+++ b/gameServer/RoomsAndClients.hs Mon Aug 16 18:43:32 2010 +0400
@@ -15,6 +15,7 @@
moveClientToRoom,
clientRoom,
clientRoomM,
+ clientExists,
client,
room,
client'sM,
@@ -139,6 +140,9 @@
moveClientToRoom rnc ri ci = moveClientInRooms rnc lobbyId ri ci
+clientExists :: MRoomsAndClients r c -> ClientIndex -> IO Bool
+clientExists (MRoomsAndClients (_, clients)) (ClientIndex ci) = elemExists clients ci
+
clientRoomM :: MRoomsAndClients r c -> ClientIndex -> IO RoomIndex
clientRoomM (MRoomsAndClients (_, clients)) (ClientIndex ci) = liftM clientRoom' (clients `readElem` ci)