Esempio n. 1
0
        public static OffsetCoord AxialToOffset(AxialCoord h)
        {
            int col = h.q;
            int row = h.r + (int)((h.q + offset * (h.q & 1)) / 2);

            return(new OffsetCoord(col, row));
        }
Esempio n. 2
0
        public Point HexToPixel(AxialCoord h)
        {
            Orientation M = orientation;
            double      x = (M.f0 * h.q + M.f1 * h.r) * size.x;
            double      y = (M.f2 * h.q + M.f3 * h.r) * size.y;

            return(new Point(x + origin.x, y + origin.y));
        }
Esempio n. 3
0
 public static OffsetCoord ToOffsetCoord(this AxialCoord self)
 {
     return(CoordConvert.AxialToOffset(self));
 }