use crate::*; pub struct VectorPoints { points: [ScreenPosition; 2], pointer: usize, } impl VectorPoints { pub fn new() -> Self { Self { points: [ScreenPosition::ZERO; 2], pointer: 0 } } pub fn push(&mut self, point: ScreenPosition) { self.points[self.pointer] = point; self.pointer = (self.pointer + 1) % 2; } pub fn get_pair(&self) -> [ScreenPosition; 2] { self.points } }