diff options
author | tcmal <me@aria.rip> | 2024-08-25 17:44:20 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-08-25 17:44:20 +0100 |
commit | 51168c753286eeee64410ab19dc9f78a4ea479e4 (patch) | |
tree | d384093c6fd11b36b189013b663f3500b18ec2a4 /stockton-levels/src/traits/models.rs | |
parent | d076d3a6fd484e298915cd85609ba9706abacc87 (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/models.rs')
-rw-r--r-- | stockton-levels/src/traits/models.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/stockton-levels/src/traits/models.rs b/stockton-levels/src/traits/models.rs index ede7f78..7d1b896 100644 --- a/stockton-levels/src/traits/models.rs +++ b/stockton-levels/src/traits/models.rs @@ -18,6 +18,8 @@ use na::Vector3; use std::ops::Range; +use super::{HasFaces, HasBrushes}; + #[derive(Debug, Clone)] pub struct Model { pub mins: Vector3<f32>, @@ -26,9 +28,9 @@ pub struct Model { pub brushes_idx: Range<u32>, } -pub trait HasModels<'a> { - type ModelsIter: Iterator<Item = &'a Model>; +pub trait HasModels: HasFaces + HasBrushes { + type ModelsIter<'a>: Iterator<Item = &'a Model>; - fn models_iter(&'a self) -> Self::ModelsIter; - fn get_model(&'a self, index: u32) -> &'a Model; + fn models_iter<'a>(&'a self) -> Self::ModelsIter<'a>; + fn get_model<'a>(&'a self, index: u32) -> &'a Model; } |