use super::Transform;
use crate::{
    components::{CodeType, Snippet},
    errors::*,
};
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()),
            true,
            None,
        )?;

        Ok(Self { snippet: snippets })
    }
}

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

    fn chain(mut self, other: impl Transform) -> Self {
        let new_snippet = self.snippet.chain(other.snippet().to_owned());
        self.snippet = new_snippet;
        self
    }
}

mod test {
    use super::*;

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