mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
more updates to space and transport
This commit is contained in:
parent
9fa858f226
commit
304ce35cbb
6 changed files with 139 additions and 140 deletions
|
|
@ -27,24 +27,6 @@ impl Direction {
|
|||
}
|
||||
}
|
||||
|
||||
impl<E: Engine, A: Render<E>, B: Render<E>> Split<E, A, B> {
|
||||
pub fn new (flip: bool, direction: Direction, proportion: E::Unit, a: A, b: B) -> Self {
|
||||
Self(flip, direction, proportion, a, b, Default::default())
|
||||
}
|
||||
pub fn n (flip: bool, proportion: E::Unit, a: A, b: B) -> Self {
|
||||
Self(flip, North, proportion, a, b, Default::default())
|
||||
}
|
||||
pub fn s (flip: bool, proportion: E::Unit, a: A, b: B) -> Self {
|
||||
Self(flip, South, proportion, a, b, Default::default())
|
||||
}
|
||||
pub fn e (flip: bool, proportion: E::Unit, a: A, b: B) -> Self {
|
||||
Self(flip, West, proportion, a, b, Default::default())
|
||||
}
|
||||
pub fn w (flip: bool, proportion: E::Unit, a: A, b: B) -> Self {
|
||||
Self(flip, East, proportion, a, b, Default::default())
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: Engine, A: Render<E>, B: Render<E>> Render<E> for Split<E, A, B> {
|
||||
fn min_size (&self, to: E::Size) -> Perhaps<E::Size> {
|
||||
Ok(Some(to))
|
||||
|
|
@ -61,16 +43,6 @@ impl<E: Engine, A: Render<E>, B: Render<E>> Render<E> for Split<E, A, B> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<E: Engine, X: Render<E>, Y: Render<E>> Bsp<E, X, Y> {
|
||||
pub fn new (x: X) -> Self { Self::A(Some(x), None) }
|
||||
pub fn n (x: X, y: Y) -> Self { Self::N(Some(x), Some(y)) }
|
||||
pub fn s (x: X, y: Y) -> Self { Self::S(Some(x), Some(y)) }
|
||||
pub fn e (x: X, y: Y) -> Self { Self::E(Some(x), Some(y)) }
|
||||
pub fn w (x: X, y: Y) -> Self { Self::W(Some(x), Some(y)) }
|
||||
pub fn a (x: X, y: Y) -> Self { Self::A(Some(x), Some(y)) }
|
||||
pub fn b (x: X, y: Y) -> Self { Self::B(Some(x), Some(y)) }
|
||||
}
|
||||
|
||||
impl<E: Engine, X: Render<E>, Y: Render<E>> Default for Bsp<E, X, Y> {
|
||||
fn default () -> Self {
|
||||
Self::Null(Default::default())
|
||||
|
|
@ -142,24 +114,6 @@ impl<E: Engine, X: Render<E>, Y: Render<E>> Render<E> for Bsp<E, X, Y> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<
|
||||
E: Engine,
|
||||
F: Send + Sync + Fn(&mut dyn FnMut(&dyn Render<E>)->Usually<()>)->Usually<()>
|
||||
> Stack<E, F> {
|
||||
#[inline] pub fn new (direction: Direction, build: F) -> Self {
|
||||
Self(build, direction, Default::default())
|
||||
}
|
||||
#[inline] pub fn right (build: F) -> Self {
|
||||
Self::new(East, build)
|
||||
}
|
||||
#[inline] pub fn down (build: F) -> Self {
|
||||
Self::new(South, build)
|
||||
}
|
||||
#[inline] pub fn up (build: F) -> Self {
|
||||
Self::new(North, build)
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: Engine, F> Render<E> for Stack<E, F>
|
||||
where
|
||||
F: Send + Sync + Fn(&mut dyn FnMut(&dyn Render<E>)->Usually<()>)->Usually<()>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue