16 lines
250 B
Rust
16 lines
250 B
Rust
#[derive(Clone, Debug)]
|
|
pub struct Coord {
|
|
pub x: isize,
|
|
pub y: isize
|
|
}
|
|
|
|
impl Coord {
|
|
pub fn new(x: isize, y: isize) -> Self {
|
|
Self { x, y }
|
|
}
|
|
|
|
pub fn invert(&mut self) {
|
|
self.x *= -1;
|
|
self.y *= -1;
|
|
}
|
|
} |