mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Add proximity test.
This commit is contained in:
parent
1572a5a759
commit
2397209b5d
@ -1914,6 +1914,16 @@ mod tests {
|
||||
assert!(!reqs.satisfied_by(Vec2 { x: -8, y: 8 }));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn complex_proximity_requirements() {
|
||||
let a_site = Vec2 { x: 572, y: 724 };
|
||||
let reqs = ProximityRequirements::new()
|
||||
.close_to_one_of(vec![a_site].into_iter(), 60)
|
||||
.avoid_all_of(vec![a_site].into_iter(), 40);
|
||||
assert!(reqs.satisfied_by(Vec2 { x: 572, y: 774 }));
|
||||
assert!(!reqs.satisfied_by(a_site));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn location_hint() {
|
||||
let reqs = ProximityRequirements::new().close_to_one_of(
|
||||
|
Loading…
Reference in New Issue
Block a user