mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
significant code simplification proposed by zesterer
This commit is contained in:
parent
b555d619fb
commit
0e73bd23ed
@ -872,22 +872,8 @@ impl SpotCondition {
|
||||
SpotCondition::IsUnderwater.is_valid(g, c) && c.water_alt > c.alt + depth
|
||||
},
|
||||
SpotCondition::Not(condition) => !condition.is_valid(g, c),
|
||||
SpotCondition::All(conditions) => 'outer: {
|
||||
for cond in conditions.iter() {
|
||||
if !cond.is_valid(g, c) {
|
||||
break 'outer false;
|
||||
}
|
||||
}
|
||||
true
|
||||
},
|
||||
SpotCondition::Any(conditions) => 'outer: {
|
||||
for cond in conditions.iter() {
|
||||
if cond.is_valid(g, c) {
|
||||
break 'outer true;
|
||||
}
|
||||
}
|
||||
false
|
||||
},
|
||||
SpotCondition::All(conditions) => conditions.iter().all(|cond| cond.is_valid(g, c)),
|
||||
SpotCondition::Any(conditions) => conditions.iter().any(|cond| cond.is_valid(g, c)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user