gameServer/RoomsAndClients.hs
changeset 3656 c74a4a407146
parent 3654 18189fbc7530
child 3741 73246d25dfe1
--- a/gameServer/RoomsAndClients.hs	Mon Jul 19 23:10:33 2010 +0400
+++ b/gameServer/RoomsAndClients.hs	Mon Jul 19 23:30:08 2010 +0400
@@ -22,6 +22,7 @@
     allClientsM,
     clientsM,
     roomClientsM,
+    roomClientsIndicesM,
     withRoomsAndClients,
     allRooms,
     allClients,
@@ -153,6 +154,9 @@
 clientsM :: MRoomsAndClients r c -> IO [c]
 clientsM (MRoomsAndClients (_, clients)) = indicesM clients >>= mapM (\ci -> liftM client' $ readElem clients ci)
 
+roomClientsIndicesM :: MRoomsAndClients r c -> RoomIndex -> IO [ClientIndex]
+roomClientsIndicesM (MRoomsAndClients (rooms, clients)) (RoomIndex ri) = liftM roomClients' (rooms `readElem` ri)
+
 roomClientsM :: MRoomsAndClients r c -> RoomIndex -> IO [c]
 roomClientsM (MRoomsAndClients (rooms, clients)) (RoomIndex ri) = liftM roomClients' (rooms `readElem` ri) >>= mapM (\(ClientIndex ci) -> liftM client' $ readElem clients ci)