| 165 | } |
| 166 | |
| 167 | static bool build_choice_matches(df::ui_build_item_req *req, df::build_req_choicest *choice, |
| 168 | MaterialInfo &new_mat, bool ignore_select) |
| 169 | { |
| 170 | if (VIRTUAL_CAST_VAR(gen, df::build_req_choice_genst, choice)) |
| 171 | { |
| 172 | if (gen->mat_type == new_mat.type && |
| 173 | gen->mat_index == new_mat.index && |
| 174 | (ignore_select || size_t(gen->used_count) < gen->candidates.size())) |
| 175 | { |
| 176 | return true; |
| 177 | } |
| 178 | } |
| 179 | else if (VIRTUAL_CAST_VAR(spec, df::build_req_choice_specst, choice)) |
| 180 | { |
| 181 | if (spec->candidate && |
| 182 | spec->candidate->getActualMaterial() == new_mat.type && |
| 183 | spec->candidate->getActualMaterialIndex() == new_mat.index && |
| 184 | (ignore_select || !req->candidate_selected[spec->candidate_id])) |
| 185 | { |
| 186 | return true; |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | return false; |
| 191 | } |
| 192 | |
| 193 | static command_result job_material_in_build(color_ostream &out, MaterialInfo &new_mat) |
| 194 | { |
no test coverage detected