* Checks whether a company manager's face is a valid encoding. * Unused bits are not enforced to be 0. * @param cmf the fact to check * @return true if and only if the face is valid */
| 184 | * @return true if and only if the face is valid |
| 185 | */ |
| 186 | static bool IsValidCompanyManagerFace(CompanyManagerFace cmf) |
| 187 | { |
| 188 | if (cmf.style >= GetNumCompanyManagerFaceStyles()) return false; |
| 189 | |
| 190 | /* Test if each enabled part is valid. */ |
| 191 | FaceVars vars = GetCompanyManagerFaceVars(cmf.style); |
| 192 | for (uint var : SetBitIterator(GetActiveFaceVars(cmf, vars))) { |
| 193 | if (!vars[var].IsValid(cmf)) return false; |
| 194 | } |
| 195 | |
| 196 | return true; |
| 197 | } |
| 198 | |
| 199 | static CompanyMask _dirty_company_finances{}; ///< Bitmask of company finances that should be marked dirty. |
| 200 |
no test coverage detected