use crate::{
Evolution, Transformation, Tf,
D_TRANSFORMATION_SPEED_EVOLUTION, D_TRANSFORMATION_START_TIME, D_TRANSFORMATION_END_TIME
};
pub struct View {
pub t: Vec<Tf>,
}
impl View {
pub fn new() -> Self {
Self {
t: vec![]
}
}
pub fn transform(mut self, transformation: Transformation) -> Self {
self.t.push(Tf {
t: transformation,
e: unsafe { D_TRANSFORMATION_SPEED_EVOLUTION },
start: unsafe { D_TRANSFORMATION_START_TIME },
end: unsafe { D_TRANSFORMATION_END_TIME },
});
self
}
pub fn evolution_t(mut self, e: Evolution) -> Self {
self.t.last_mut().unwrap().e = e;
self
}
pub fn start_t(mut self, start: f32) -> Self {
self.t.last_mut().unwrap().start = start;
self
}
pub fn end_t(mut self, end: f32) -> Self {
self.t.last_mut().unwrap().end = end;
self
}
}