public Vector2 GetPixelVectorFromHex(HexBase hex) { var x = hex.q * hexwidth + hex.r * hexwidth / 2; float y = (float)((hexheight * 3 / 4) * hex.r); return(new Vector2(x, y)); }
public bool Equals(HexBase <T> other) { if (other is null) { return(false); } return(Q.Equals(other.Q) && R.Equals(other.R) && S.Equals(other.S)); }
public static HexMap GetEmptyHexMap(int width, int height, GraphicsDevice graphicsDevice) //Returns a hex map of specified size with Grass Tiles { HexBase[,] nFloorHexes = new HexBase[width, height]; for (int q = 0; q < width; q++) { for (int r = 0; r < height; r++) { nFloorHexes[q, r] = new HexBase("GreenHex"); nFloorHexes[q, r].q = q; nFloorHexes[q, r].r = r; nFloorHexes[q, r].s = -q - r; } } return(new HexMap(nFloorHexes, graphicsDevice)); }
public void addHexInfoWindow(Vector2 position, HexBase hexbase) { }
protected void OnEnable() { targetHexBase = target as HexBase; }