gameServer/RoomsAndClients.hs
changeset 8452 170afc3ac39f
parent 6805 097289be7200
child 10215 26fc5502ba22
--- a/gameServer/RoomsAndClients.hs	Sun Jan 27 21:46:25 2013 +0400
+++ b/gameServer/RoomsAndClients.hs	Mon Jan 28 00:50:00 2013 +0400
@@ -23,6 +23,7 @@
     room'sM,
     allClientsM,
     clientsM,
+    roomsM,
     roomClientsM,
     roomClientsIndicesM,
     withRoomsAndClients,
@@ -160,6 +161,9 @@
 clientsM :: MRoomsAndClients r c -> IO [c]
 clientsM (MRoomsAndClients (_, clients)) = indicesM clients >>= mapM (liftM client' . readElem clients)
 
+roomsM :: MRoomsAndClients r c -> IO [r]
+roomsM (MRoomsAndClients (rooms, _)) = indicesM rooms >>= mapM (liftM room' . readElem rooms)
+
 roomClientsIndicesM :: MRoomsAndClients r c -> RoomIndex -> IO [ClientIndex]
 roomClientsIndicesM (MRoomsAndClients (rooms, _)) (RoomIndex ri) = liftM roomClients' (rooms `readElem` ri)