Esempio n. 1
0
 public void NeighborsUpdate(HexTile hexTile)
 {
     foreach (var edgeData in hexTile.Data.HexEdgesData)
     {
         if (!edgeData.IsOpen)
         {
             continue;
         }
         var direction    = edgeData.HexDiraction;
         var neighborTile = HexUtils.GetNeighborTile(hexTile, direction);
         if (neighborTile != null)
         {
             var neighborEdge = neighborTile.Data.HexEdgesData[(int)HexUtils.OppsiteHex[direction]];
             neighborEdge.HexEdgeType = edgeData.HexEdgeType;
             neighborEdge.IsOpen      = edgeData.IsOpen;
             neighborTile.SyncVisual();
         }
     }
 }