hexagon_map/point/
h_point.rs

1use super::*;
2
3/// A point in 3D stepped coordinate
4#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Serialize, Deserialize)]
5pub struct HPoint {
6    /// S-axis index, X-axis index in cube coordinates
7    pub y: isize,
8    /// Q-axis index, Z-axis index in cube coordinates
9    pub x: isize,
10}
11
12impl HPoint {
13    pub fn new(x: isize, y: isize) -> Self {
14        Self { x, y }
15    }
16    pub fn go(&self, direction: Orientation) -> Self {
17        <HPoint as Into<CubicPoint>>::into(*self).go(direction).into()
18    }
19}