Skillset random_skills(Security::Mask s) { // For now, ignore the clearance (void)s; Skillset r; for (uint c = 0; c < r.skills.size(); ++c) { r.get((Category)c) = Skill(rand() % 10); } return r; }
void consumeAttr(Skillset& mine, const Skillset& his, vector<string>& adjectives) { bool was = false; for (SkillId id : ENUM_ALL(SkillId)) { if (mine.getValue(id) < his.getValue(id)) { mine.setValue(id, his.getValue(id)); was = true; } } if (was) adjectives.push_back("more skillfull"); }
void consumeAttr(Skillset& mine, const Skillset& his, vector<string>& adjectives) { bool was = false; for (SkillId id : his.getAllDiscrete()) if (!mine.hasDiscrete(id) && Skill::get(id)->transferOnConsumption() && consumeProb()) { mine.insert(id); was = true; } for (SkillId id : ENUM_ALL(SkillId)) { if (!Skill::get(id)->isDiscrete() && mine.getValue(id) < his.getValue(id)) { mine.setValue(id, his.getValue(id)); was = true; } } if (was) adjectives.push_back("more skillfull"); }