use std::fmt;
#[derive(Clone, Copy)]
pub struct KusaCell {
pub x: i32,
pub y: i32,
}
impl Default for KusaCell {
fn default() -> Self {
KusaCell { x: 0, y: 0 }
}
}
impl KusaCell {
}
impl fmt::Debug for KusaCell {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "cell=({}, {})", self.x, self.y)
}
}
#[derive(Clone, Copy)]
pub struct KusaPoint {
pub x: f64,
pub y: f64,
}
impl Default for KusaPoint {
fn default() -> Self {
KusaPoint { x: 0.0, y: 0.0 }
}
}
impl KusaPoint {
pub fn from_coord(coord: [f64; 2]) -> Self {
KusaPoint {
x: coord[0],
y: coord[1],
}
}
}
impl fmt::Debug for KusaPoint {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "point=({}, {})", self.x, self.y)
}
}
#[derive(Clone, Copy)]
pub struct KusaSize {
pub width: f64,
pub height: f64,
}
impl KusaSize {
}
impl fmt::Debug for KusaSize {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "pos=({}, {})", self.width, self.height)
}
}