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