dungen_minion_geometry 0.3.2

Geometry support for dungen_minion.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// External includes.

// Standard includes.

// Internal includes.
use super::{IntersectsShape, PlacedShape};

/// Defines an intersection operation between this instance and a [`PlacedShape`](trait.PlacedShape.html).
pub trait IntersectsPlacedShape: IntersectsShape {
    /// Returns true if the given `PlacedShape` at is within the boundaries of this instance.
    fn intersects_placed_shape(&self, placed_shape: &dyn PlacedShape) -> bool {
        self.intersects_shape(placed_shape.position(), placed_shape.as_shape())
    }
}