static public Hex RoffsetToCube(int offset, OffsetCoord h) { int q = h.col - (int)((h.row + offset * (h.row & 1)) / 2); int r = h.row; int s = -q - r; if (offset != OffsetCoord.EVEN && offset != OffsetCoord.ODD) { throw new ArgumentException("offset must be EVEN (+1) or ODD (-1)"); } return(new Hex(q, r, s)); }
public OffsetCoord ToOffsetCoord() { return(OffsetCoord.QoffsetFromCube(OffsetCoord.ODD, this)); }