pub fn depot_in_middle(&self) -> Option<Point2> {
		let upper_len = self.upper().len();
		if upper_len != 2 && upper_len != 5 {
			return None;
		}
		if let Some(ps) = self.upper2_for_ramp_wall() {
			let p1 = Point2::from(ps[0]);
			let p2 = Point2::from(ps[1]);

			let intersects = p1.circle_intersection(p2, 1.581_138_8)?; // 2.5_f32.sqrt()
			let (x, y) = *self.lower().first()?;
			let lower = Point2::new(x as f32, y as f32);

			return intersects.iter().furthest(lower).copied();
		}
		None
	}
/// Returns correct position to build supply in middle of wall from 3 supplies.
Returns correct position to build supply in middle of wall from 3 supplies.
Returns correct position to build supply in middle of wall from 3 supplies .
pub fn depot_in_middle(&self) -> Option<Point2> {
		let upper_len = self.upper().len();
		if upper_len != 2 && upper_len != 5 {
			return None;
		}
		if let Some(ps) = self.upper2_for_ramp_wall() {
			let p1 = Point2::from(ps[0]);
			let p2 = Point2::from(ps[1]);
			let intersects = p1.circle_intersection(p2, 1.581_138_8)?; // 2.5_f32.sqrt()
			let (x, y) = *self.lower().first()?;
			let lower = Point2::new(x as f32, y as f32);
			return intersects.iter().furthest(lower).copied();
		}
		None
	}
pub fn depot_in_middle ( & self ) -> Option < Point2 > { let upper_len = self . upper ( ) . len ( ) ; if upper_len != 2 && upper_len != 5 { return None ; } if let Some ( ps ) = self . upper2_for_ramp_wall ( ) { let p1 = Point2 :: from ( ps [ 0 ] ) ; let p2 = Point2 :: from ( ps [ 1 ] ) ; let intersects = p1 . circle_intersection ( p2 , 1.581_138_8 ) ? ; // 2.5_f32.sqrt() let ( x , y ) = * self . lower ( ) . first ( ) ? ; let lower = Point2 :: new ( x as f32 , y as f32 ) ; return intersects . iter ( ) . furthest ( lower ) . copied ( ) ; } None }
Returns correct position to build supply in middle of wall from 3 supplies.
Returns correct position to build supply in middle of wall from 3 supplies .
&self
&self