use super::Transform;
use crate::{
    components::{CodeType, Program, Snippet},
    errors::*,
    graphics::AttaWithProgram,
};
#[derive(Debug, Clone)]
pub struct Position {
    snippet: Snippet,
}

impl Position {
    pub fn new() -> Result<Self> {
        let snippets = Snippet::new(
            "position",
            CodeType::<&'static str>::Path("transform/position.glsl".into()),
            false,
            None,
        )?;

        Ok(Self { snippet: snippets })
    }
}

impl Transform for Position {
    fn snippet(&self) -> &Snippet {
        &self.snippet
    }
}

impl AttaWithProgram for Position {
    fn attach_with_program(&self, gl: &glow::Context, program: &Program) -> Result<()> {
        Ok(())
    }
}

mod test {
    use super::*;

    #[test]
    fn test_position() {
        let position = Position::new().unwrap();
    }
}
