aboutsummaryrefslogtreecommitdiff
path: root/stockton-levels/src/traits/brushes.rs
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-08-25 17:44:20 +0100
committertcmal <me@aria.rip>2024-08-25 17:44:20 +0100
commit51168c753286eeee64410ab19dc9f78a4ea479e4 (patch)
treed384093c6fd11b36b189013b663f3500b18ec2a4 /stockton-levels/src/traits/brushes.rs
parentd076d3a6fd484e298915cd85609ba9706abacc87 (diff)
refactor(all): use new traits-based levels everywhere else.
unfortunately this also starts using an unstable feature - generic_associated_types see rust-lang/rust#44265
Diffstat (limited to 'stockton-levels/src/traits/brushes.rs')
-rw-r--r--stockton-levels/src/traits/brushes.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/stockton-levels/src/traits/brushes.rs b/stockton-levels/src/traits/brushes.rs
index 0b07653..6131824 100644
--- a/stockton-levels/src/traits/brushes.rs
+++ b/stockton-levels/src/traits/brushes.rs
@@ -17,6 +17,8 @@
//! Parses the brushes & brushsides lumps from a bsp file
+use super::HasPlanes;
+
/// One brush record. Used for collision detection.
/// "Each brush describes a convex volume as defined by its surrounding surfaces."
#[derive(Debug, Clone, PartialEq)]
@@ -33,9 +35,9 @@ pub struct BrushSide {
pub is_opposing: bool,
}
-pub trait HasBrushes<'a> {
- type BrushesIter: Iterator<Item = &'a Brush>;
+pub trait HasBrushes: HasPlanes {
+ type BrushesIter<'a>: Iterator<Item = &'a Brush>;
- fn brushes_iter(&'a self) -> Self::BrushesIter;
- fn get_brush(&'a self, index: u32) -> &'a Brush;
+ fn brushes_iter<'a>(&'a self) -> Self::BrushesIter<'a>;
+ fn get_brush<'a>(&'a self, index: u32) -> &'a Brush;
}