public void SetNeighbours(MegaTile westTile, MegaTile eastTile, MegaTile northTile, MegaTile southTile)
{
//Store a reference to all neighbours
WestMegaTile = westTile;
EastMegaTile = eastTile;
NorthMegaTile = northTile;
SouthMegaTile = southTile;
//Figure out if this mega tile should draw roads because of neighbours
if (!megaTileType.CanHaveRoads)
{
//Check if a road should be drawn to the west
if (WestMegaTile != null && WestMegaTile.MegaTileType.CanHaveRoads)
{
westRoad = true;
}
//Check if a road should be drawn to the north
if (NorthMegaTile != null && NorthMegaTile.MegaTileType.CanHaveRoads)
{
northRoad = true;
}
//Place a 4way intersection texture if both roads are present
if (westRoad && northRoad)
{
intersection = true;
}
}
//Place a 4-way texture if tiles above and left both have roads
//if (!WestRoad && !NorthRoad)
//{
if ((WestMegaTile != null && WestMegaTile.NorthRoad) || (NorthMegaTile != null && NorthMegaTile.WestRoad))
{
intersection = true;
}
//}
}