gameServer/RoomsAndClients.hs
changeset 10215 26fc5502ba22
parent 8452 170afc3ac39f
child 10216 6928a323097f
equal deleted inserted replaced
10214:426aafe1f3ed 10215:26fc5502ba22
   156 room'sM (MRoomsAndClients (rooms, _)) f (RoomIndex ri) = liftM (f . room') (rooms `readElem` ri)
   156 room'sM (MRoomsAndClients (rooms, _)) f (RoomIndex ri) = liftM (f . room') (rooms `readElem` ri)
   157 
   157 
   158 allClientsM :: MRoomsAndClients r c -> IO [ClientIndex]
   158 allClientsM :: MRoomsAndClients r c -> IO [ClientIndex]
   159 allClientsM (MRoomsAndClients (_, clients)) = liftM (map ClientIndex) $ indicesM clients
   159 allClientsM (MRoomsAndClients (_, clients)) = liftM (map ClientIndex) $ indicesM clients
   160 
   160 
       
   161 allRoomsM :: MRoomsAndClients r c -> IO [RoomIndex]
       
   162 allRoomsM (MRoomsAndClients (rooms, _)) = liftM (map RoomIndex) $ indicesM rooms
       
   163 
   161 clientsM :: MRoomsAndClients r c -> IO [c]
   164 clientsM :: MRoomsAndClients r c -> IO [c]
   162 clientsM (MRoomsAndClients (_, clients)) = indicesM clients >>= mapM (liftM client' . readElem clients)
   165 clientsM (MRoomsAndClients (_, clients)) = indicesM clients >>= mapM (liftM client' . readElem clients)
   163 
   166 
   164 roomsM :: MRoomsAndClients r c -> IO [r]
   167 roomsM :: MRoomsAndClients r c -> IO [r]
   165 roomsM (MRoomsAndClients (rooms, _)) = indicesM rooms >>= mapM (liftM room' . readElem rooms)
   168 roomsM (MRoomsAndClients (rooms, _)) = indicesM rooms >>= mapM (liftM room' . readElem rooms)