Example #1
0
        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));
        }
Example #2
0
 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));
 }
Example #3
0
 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));
 }
Example #4
0
 public void addHexInfoWindow(Vector2 position, HexBase hexbase)
 {
 }
Example #5
0
 protected void OnEnable()
 {
     targetHexBase = target as HexBase;
 }