public HexGridCell <TCellValue> GetCell(AxialCoord axialCoord) { HexGridCell <TCellValue> value = null; cells.TryGetValue(axialCoord.ToString(), out value); return(value); }
public static PixelCoord AxialToPixel(AxialCoord coord, float size) { float x = size * 3f / 2f * (float)coord.q; float y = size * (float)Math.Sqrt(3.0) * ((float)coord.r + (float)coord.q / 2f); return(new PixelCoord(x, y)); }
public static void CubeToAxial(ref CubeCoord coord, out AxialCoord outCoord) { outCoord = new AxialCoord(coord.x, coord.y); }
public static AxialCoord GetNeighbour(AxialCoord coord, uint direction) { return(coord + AxialCoord.Directions[direction]); }
public static PixelCoord AxialToPixel(CubeCoord coord, float size) { AxialCoord coord2 = CubeToAxial(coord); return(AxialToPixel(coord2, size)); }
public static CubeCoord AxialToCube(AxialCoord coord) { return(new CubeCoord(coord.q, coord.r, -coord.q - coord.r)); }
public static void AxialToCube(ref AxialCoord coord, out CubeCoord outCoord) { outCoord = new CubeCoord(coord.q, coord.r, -coord.q - coord.r); }
public void SetCellValue(TCellValue value, AxialCoord coord) { HexGridCell <TCellValue> cell = GetCell(coord); cell.Value = value; }
public TCellValue GetCellValue(AxialCoord coord) { return(GetCell(coord).Value); }