cleanup
This commit is contained in:
@@ -235,11 +235,13 @@ impl Board {
|
||||
self.solid_at(x, y).is_none()
|
||||
}
|
||||
|
||||
/// Returns `true` if the mover as `(x1, y1)` can enter `(x2, y2)` — i.e. it would not
|
||||
/// break the rules of "one solid per cell, except for player + grab".
|
||||
/// Returns `true` if the solids at `(x1, y1)` and `(x2, y2)` may share a cell —
|
||||
/// i.e. moving one onto the other wouldn't break the "one solid per cell"
|
||||
/// invariant. That holds when at least one cell is empty, or one holds the
|
||||
/// player and the other a **grab** thing (the player collects it).
|
||||
///
|
||||
/// Convenience inverse of [`solid_at`](Board::solid_at).
|
||||
/// Panics if `x` or `y` are out of bounds.
|
||||
/// Off-board coordinates are never combinable (returns `false` rather than
|
||||
/// panicking). Backs the script-facing `combinable(x1, y1, x2, y2)` fn.
|
||||
pub fn is_combinable(&self, x1: usize, y1: usize, x2: usize, y2: usize) -> bool {
|
||||
// Are either out of bounds?
|
||||
if !self.in_bounds((x1 as i32, y1 as i32)) || !self.in_bounds((x2 as i32, y2 as i32)) {
|
||||
|
||||
Reference in New Issue
Block a user