Exemple #1
0
 /// <summary>
 /// Sets internal fields and calls CalculateVertices()
 /// </summary>
 private void Initialize(float x, float y, float side, Hexagonal.HexOrientation orientation)
 {
     this.x           = x;
     this.y           = y;
     this.side        = side;
     this.orientation = orientation;
     this.hexState    = new HexState();
     CalculateVertices();
 }
Exemple #2
0
        /// <summary>
        /// Constructor to initalize the Hexagon with the fixed values
        /// </summary>
        /// <param name="side">Hexagon side length</param>
        /// <param name="playerColor">The players color</param>
        /// <param name="posX">The X position in the grid</param>
        /// <param name="posY">The Y position in the grid</param>
        /// <param name="dices">Number of dices on this Hex</param>
        public Hex(float side, Color playerColor, int posX, int posY, int dices, bool isWater)
        {
            this.side     = side;
            this.hexState = new HexState(isWater ? WaterColor : playerColor);
            this.dices    = dices;
            this.IsWater  = isWater;

            this.gridPosX = posY;
            this.gridPosY = posX;
        }
Exemple #3
0
 /// <summary>
 /// Sets internal fields and calls CalculateVertices()
 /// </summary>
 private void Initialize(float x, float y, float side, int col, int row, Hexagonal.HexOrientation orientation)
 {
     this.id          = ((1000000 + ((int)x * 1000)) + (int)y);
     this.x           = x;
     this.y           = y;
     this.side        = side;
     this.col         = col;
     this.row         = row;
     this.orientation = orientation;
     this.hexState    = new HexState();
     CalculateVertices();
 }
Exemple #4
0
 /// <summary>
 ///     Sets internal fields and calls CalculateVertices()
 /// </summary>
 private void Initialize(float x, float y, float side, HexOrientation orientation)
 {
     this.x = x;
     this.y = y;
     this.side = side;
     Orientation = orientation;
     hexState = new HexState();
     CalculateVertices();
 }