mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-03 20:13:56 -07:00
Run formatter on all our files (#6942)
This commit is contained in:
parent
b3c89167c5
commit
1d5d3f2d38
19 changed files with 153 additions and 81 deletions
|
|
@ -251,20 +251,27 @@ static void setupParserRules()
|
|||
const auto arg = std::any_cast<int>(sv[1]);
|
||||
const auto op = std::any_cast<QString>(sv[0]);
|
||||
|
||||
if (op == ">")
|
||||
if (op == ">") {
|
||||
return [=](const int s) { return s > arg; };
|
||||
if (op == ">=")
|
||||
}
|
||||
if (op == ">=") {
|
||||
return [=](const int s) { return s >= arg; };
|
||||
if (op == "<")
|
||||
}
|
||||
if (op == "<") {
|
||||
return [=](const int s) { return s < arg; };
|
||||
if (op == "<=")
|
||||
}
|
||||
if (op == "<=") {
|
||||
return [=](const int s) { return s <= arg; };
|
||||
if (op == "=")
|
||||
}
|
||||
if (op == "=") {
|
||||
return [=](const int s) { return s == arg; };
|
||||
if (op == ":")
|
||||
}
|
||||
if (op == ":") {
|
||||
return [=](const int s) { return s == arg; };
|
||||
if (op == "!=")
|
||||
}
|
||||
if (op == "!=") {
|
||||
return [=](const int s) { return s != arg; };
|
||||
}
|
||||
return [](int) { return false; };
|
||||
};
|
||||
|
||||
|
|
@ -315,8 +322,9 @@ static void setupParserRules()
|
|||
return true;
|
||||
}
|
||||
|
||||
if (parts.contains("c") && match.length() == 0)
|
||||
if (parts.contains("c") && match.length() == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
auto containsColor = [&parts](const QString &s) { return parts.contains(s); };
|
||||
return std::any_of(match.begin(), match.end(), containsColor);
|
||||
|
|
|
|||
|
|
@ -205,8 +205,9 @@ bool FilterItem::acceptColor(const CardInfoPtr info) const
|
|||
*/
|
||||
int match_count = 0;
|
||||
for (auto &it : converted_term) {
|
||||
if (info->getColors().contains(it, Qt::CaseInsensitive))
|
||||
if (info->getColors().contains(it, Qt::CaseInsensitive)) {
|
||||
match_count++;
|
||||
}
|
||||
}
|
||||
|
||||
return match_count == converted_term.length();
|
||||
|
|
@ -542,12 +543,14 @@ void FilterTree::removeFilter(const CardFilter *toRemove)
|
|||
{
|
||||
for (int i = childNodes.size() - 1; i >= 0; --i) {
|
||||
auto *logicMap = dynamic_cast<LogicMap *>(childNodes.at(i));
|
||||
if (!logicMap || logicMap->attr != toRemove->attr())
|
||||
if (!logicMap || logicMap->attr != toRemove->attr()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
FilterItemList *typeList = logicMap->typeList(toRemove->type());
|
||||
if (!typeList)
|
||||
if (!typeList) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int termIdx = typeList->termIndex(toRemove->term());
|
||||
if (termIdx != -1) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue