pub fn verify_join(&self, start: &puzzleverse_core::Point, end: &puzzleverse_core::Point, skip_gate_check: bool) -> bool {
    if start.platform == end.platform {
      true
    } else {
      self
        .platforms
        .get(start.platform as usize)
        .map(|start_platform| {
          start_platform.bridges.iter().any(|bridge| {
            bridge.target_platform == end.platform as usize
              && match &bridge.edge {
                PlatformEdge::Top => start.y == 0 && bridge.location.contains(&start.x),
                PlatformEdge::Left => start.x == 0 && bridge.location.contains(&start.y),
                PlatformEdge::Right => start.x == start_platform.width - 1 && bridge.location.contains(&start.y),
                PlatformEdge::Bottom => start.y == start_platform.length - 1 && bridge.location.contains(&start.x),
              }
              && (skip_gate_check
                || match &bridge.condition {
                  BridgeCondition::Static(_, _) => true,
                  BridgeCondition::PuzzleGated(gate, _, _) => gate.load(std::sync::atomic::Ordering::Relaxed),
                })
          })
        })
        .unwrap_or(false)
    }
  }
/// Determine if a player can cross between two grids in the current state
Determine if a player can cross between two grids in the current state
Determine if a player can cross between two grids in the current state
pub fn verify_join(&self, start: &puzzleverse_core::Point, end: &puzzleverse_core::Point, skip_gate_check: bool) -> bool {
    if start.platform == end.platform {
      true
    } else {
      self
        .platforms
        .get(start.platform as usize)
        .map(|start_platform| {
          start_platform.bridges.iter().any(|bridge| {
            bridge.target_platform == end.platform as usize
              && match &bridge.edge {
                PlatformEdge::Top => start.y == 0 && bridge.location.contains(&start.x),
                PlatformEdge::Left => start.x == 0 && bridge.location.contains(&start.y),
                PlatformEdge::Right => start.x == start_platform.width - 1 && bridge.location.contains(&start.y),
                PlatformEdge::Bottom => start.y == start_platform.length - 1 && bridge.location.contains(&start.x),
              }
              && (skip_gate_check
                || match &bridge.condition {
                  BridgeCondition::Static(_, _) => true,
                  BridgeCondition::PuzzleGated(gate, _, _) => gate.load(std::sync::atomic::Ordering::Relaxed),
                })
          })
        })
        .unwrap_or(false)
    }
  }
pub fn verify_join ( & self , start : & puzzleverse_core :: Point , end : & puzzleverse_core :: Point , skip_gate_check : bool ) -> bool { if start . platform == end . platform { true } else { self . platforms . get ( start . platform as usize ) . map ( | start_platform | { start_platform . bridges . iter ( ) . any ( | bridge | { bridge . target_platform == end . platform as usize && match & bridge . edge { PlatformEdge :: Top => start . y == 0 && bridge . location . contains ( & start . x ) , PlatformEdge :: Left => start . x == 0 && bridge . location . contains ( & start . y ) , PlatformEdge :: Right => start . x == start_platform . width - 1 && bridge . location . contains ( & start . y ) , PlatformEdge :: Bottom => start . y == start_platform . length - 1 && bridge . location . contains ( & start . x ) , } && ( skip_gate_check || match & bridge . condition { BridgeCondition :: Static ( _ , _ ) => true , BridgeCondition :: PuzzleGated ( gate , _ , _ ) => gate . load ( std :: sync :: atomic :: Ordering :: Relaxed ) , } ) } ) } ) . unwrap_or ( false ) } }
Determine if a player can cross between two grids in the current state
Determine if a player can cross between two grids in the current state
&self
start
&puzzleverse_core::Point
end
&puzzleverse_core::Point
skip_gate_check
bool
&self
start
&puzzleverse_core::Point
end
&puzzleverse_core::Point
skip_gate_check
bool