1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use crate::PathD;

#[derive(Clone, Debug)]
pub struct PathsD(pub(crate) Vec<PathD>);

impl PathsD {
    pub fn new(paths: &Vec<PathD>) -> Self {
        Self(paths.clone())
    }

    pub fn is_empty(&self) -> bool {
        self.0.is_empty()
    }

    pub fn len(&self) -> usize {
        self.0.len()
    }

    pub fn get_path(&self, index: usize) -> PathD {
        self.0[index].clone()
    }

    pub fn add_path(&mut self, path: PathD) {
        self.0.push(path)
    }

    pub fn add_paths(&mut self, mut paths: Vec<PathD>) {
        self.0.append(&mut paths)
    }
    
    pub fn get_paths(&self) -> Vec<PathD> {
        self.0.clone()
    }
}