Skip to content

Commit

Permalink
Support usage= in SUF
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Apr 12, 2018
1 parent 3519ed0 commit 5442f45
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/units/filter.cpp
Expand Up @@ -493,6 +493,19 @@ void unit_filter_compound::fill(vconfig cfg)
}
);

create_attribute(literal["usage"],
[](const config::attribute_value& c) { return utils::split(c.str()); },
[](const std::vector<std::string>& usages, const unit_filter_args& args)
{
for(const std::string& usage : usages) {
if(args.u.usage() == usage) {
return true;
}
}
return false;
}
);

create_attribute(literal["canrecruit"],
[](const config::attribute_value& c) { return c.to_bool(); },
[](bool canrecruit, const unit_filter_args& args)
Expand Down

0 comments on commit 5442f45

Please sign in to comment.