~ruther/map-led-strip

ref: b7e43afe1dd99a6454be3c355d038bd228571ba2 map-led-strip/src/animations/animation.rs -rw-r--r-- 568 bytes
b7e43afe — František Boháček feat: add map clear 1 year, 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// different kinds of animation
// steps, each step has given length
// each step has LED states

// each step will show current led states on the board

use libm::{ceilf, powf};
use crate::animations::animation_step::AnimationStep;
use crate::map::Map;

pub trait Animation {
    fn is_started(&self) -> bool;
    fn init(&mut self) -> Result<(), AnimationError>;
    fn next(&mut self) -> Result<AnimationStep, AnimationError>;
    fn apply(&mut self, map: &mut Map) -> Result<(), AnimationError>;
}

#[derive(Eq, PartialEq)]
pub enum AnimationError {
    LastStep
}
Do not follow this link