use crate::entities::waypoint::structure::Waypoint;
use super::structure::Samples;
pub struct SamplesBuilder {
waypoints: Vec<Waypoint>,
}
impl SamplesBuilder {
pub fn new() -> Self {
SamplesBuilder {
waypoints: Vec::new(),
}
}
pub fn add_waypoint(mut self, waypoint: Waypoint) -> Self {
self.waypoints.push(waypoint);
self
}
pub fn build(self) -> Result<Samples, &'static str> {
Ok(Samples {
waypoints: self.waypoints,
})
}
}
impl Default for SamplesBuilder {
fn default() -> Self {
Self::new()
}
}