Implement `Insert` for `Polygon`

This commit is contained in:
Hanno Braun 2023-05-04 11:31:49 +02:00
parent 4b6fa6aa5a
commit 21ed191cf7
1 changed files with 14 additions and 0 deletions

View File

@ -7,6 +7,8 @@ use crate::{
storage::Handle,
};
use super::Polygon;
/// Insert an object into its respective store
///
/// This is the only primitive operation that is directly understood by
@ -77,3 +79,15 @@ pub struct IsInsertedNo;
impl IsInserted for IsInsertedNo {
type T<T> = T;
}
impl<const D: usize> Insert for Polygon<D, IsInsertedNo> {
type Inserted = Polygon<D, IsInsertedYes>;
fn insert(self, services: &mut Services) -> Self::Inserted {
Polygon {
face: self.face.insert(services),
edges: self.edges,
vertices: self.vertices,
}
}
}