Esempio n. 1
0
 public bool Tile_IsAdjacentTo(tile tile1, tile tile2)
 {
     int[] temp = new int[3];
     temp = tile1.XYZLibraryCoordinates();
     temp[0]++;
     temp[1]++;
     //temp[2];
     if (temp[0] == tile2.XYZLibraryCoordinates()[0] &&
         temp[1] == tile2.XYZLibraryCoordinates()[1] &&
         temp[2] == tile2.XYZLibraryCoordinates()[2])
     {
         return true;
     }
     temp = tile1.XYZLibraryCoordinates();
     temp[1]++;
     temp[2]++;
     //temp[2];
     if (temp[0] == tile2.XYZLibraryCoordinates()[0] &&
         temp[1] == tile2.XYZLibraryCoordinates()[1] &&
         temp[2] == tile2.XYZLibraryCoordinates()[2])
     {
         return true;
     }
     temp = tile1.XYZLibraryCoordinates();
     temp[2]++;
     temp[0]--;
     //temp[2];
     if (temp[0] == tile2.XYZLibraryCoordinates()[0] &&
         temp[1] == tile2.XYZLibraryCoordinates()[1] &&
         temp[2] == tile2.XYZLibraryCoordinates()[2])
     {
         return true;
     }
     temp = tile1.XYZLibraryCoordinates();
     temp[0]--;
     temp[1]--;
     //temp[2];
     if (temp[0] == tile2.XYZLibraryCoordinates()[0] &&
         temp[1] == tile2.XYZLibraryCoordinates()[1] &&
         temp[2] == tile2.XYZLibraryCoordinates()[2])
     {
         return true;
     }
     temp = tile1.XYZLibraryCoordinates();
     temp[1]--;
     temp[2]--;
     //temp[2];
     if (temp[0] == tile2.XYZLibraryCoordinates()[0] &&
         temp[1] == tile2.XYZLibraryCoordinates()[1] &&
         temp[2] == tile2.XYZLibraryCoordinates()[2])
     {
         return true;
     }
     temp = tile1.XYZLibraryCoordinates();
     temp[2]--;
     temp[0]++;
     //temp[2];
     if (temp[0] == tile2.XYZLibraryCoordinates()[0] &&
         temp[1] == tile2.XYZLibraryCoordinates()[1] &&
         temp[2] == tile2.XYZLibraryCoordinates()[2])
     {
         return true;
     }
     return false;
 }