public GridTile AutoConnectToNext(GridTile c, GetNeighboursHandler del) { List <GridTile> tempList = del(c); foreach (GridTile t in tempList) { if (t is ConveyorTile) { if (ConnectToConveyorBeginning(c, t as ConveyorTile) != null) { return(t); } } else if (!(t is EmptyTile) && !(t is CheckInTile) && !(c is MPATile)) { ConnectTiles(c, t); return(t); } } return(null); }
public GridTile AutoConnectToPrev(GridTile c, GetNeighboursHandler del) { List <GridTile> tempList = del(c); foreach (GridTile t in tempList) { if (t is ConveyorTile) { if (ConnectToConveyorPrevious(c, t as ConveyorTile) != null) { return(t); } } else if (!(t is EmptyTile) && !(t is DropOffTile) && !(c is MPATile) && (t.NextTile == null)) { ConnectTiles(t, c); return(t); } } return(null); }