* Close all windows of a company. We identify windows of a company * by looking at the caption colour. If it is equal to the company ID * then we say the window belongs to the company and should be closed * @param id company identifier */
| 1221 | * @param id company identifier |
| 1222 | */ |
| 1223 | void CloseCompanyWindows(CompanyID id) |
| 1224 | { |
| 1225 | /* Note: the container remains stable, even when deleting windows. */ |
| 1226 | for (Window *w : Window::Iterate()) { |
| 1227 | if (w->owner == id) { |
| 1228 | w->Close(); |
| 1229 | } |
| 1230 | } |
| 1231 | |
| 1232 | /* Also delete the company specific windows that don't have a company-colour. */ |
| 1233 | CloseWindowById(WC_BUY_COMPANY, id); |
| 1234 | } |
| 1235 | |
| 1236 | /** |
| 1237 | * Change the owner of all the windows one company can take over from another |
no test coverage detected