fn movement_result(&self, current_pos: &Coord) -> (Coord, Vec<Coord>) {
        match self {
            Self::Move { dir, .. } => {
                let destination = *current_pos + *dir;
                (destination, vec![destination])
            }
            Self::Silence { dir, distance } => {
                let mut current_pos = *current_pos;
                let mut newly_visited = Vec::with_capacity(*distance);
                for _ in 1..=*distance {
                    current_pos = current_pos + *dir;
                    newly_visited.push(current_pos);
                }
                (current_pos, newly_visited)
            }
            _ => panic!("Self::destination: not a movement action, \"{:?}\"", &self),
        }
    }
// cond: self is a valid movement from current_pos
// ret: (destination coord, newly visited coords)
self is a valid movement from current_pos
ret: (destination coord, newly visited coords)
self is a valid movement from current_pos ret : ( destination coord newly visited coords )
fn movement_result(&self, current_pos: &Coord) -> (Coord, Vec<Coord>) {
        match self {
            Self::Move { dir, .. } => {
                let destination = *current_pos + *dir;
                (destination, vec![destination])
            }
            Self::Silence { dir, distance } => {
                let mut current_pos = *current_pos;
                let mut newly_visited = Vec::with_capacity(*distance);
                for _ in 1..=*distance {
                    current_pos = current_pos + *dir;
                    newly_visited.push(current_pos);
                }
                (current_pos, newly_visited)
            }
            _ => panic!("Self::destination: not a movement action, \"{:?}\"", &self),
        }
    }
fn movement_result ( & self , current_pos : & Coord ) -> ( Coord , Vec < Coord > ) { match self { Self :: Move { dir , .. } => { let destination = * current_pos + * dir ; ( destination , vec ! [ destination ] ) } Self :: Silence { dir , distance } => { let mut current_pos = * current_pos ; let mut newly_visited = Vec :: with_capacity ( * distance ) ; for _ in 1 ..= * distance { current_pos = current_pos + * dir ; newly_visited . push ( current_pos ) ; } ( current_pos , newly_visited ) } _ => panic ! ( " \" \" " self ) , } }
cond: self is a valid movement from current_pos
ret: (destination coord, newly visited coords)
cond : self is a valid movement from current_pos ret : ( destination coord newly visited coords )
&self
current_pos
&Coord
&self
current_pos
&Coord