public static void addRowingBoat(BoatProperties b, BoatProperties[] rowingTxtArray) { for (int i = 0; i < rowingTxtArray.Length; i++) { if (b is RowingBoat) { if (b.ArrayPosition == i) { rowingTxtArray[i] = b; break; } } } }
public static void addBoat(BoatProperties b, BoatProperties[] boatArray) { for (int i = 0; i < boatArray.Length; i++) { if (b is RowingBoat) { if (b.ArrayPosition == i) { boatArray[i] = b; break; } } if (b is CargoShip) { if (b.ArrayPosition == i) { boatArray[i] = b; break; } } if (b is PowerBoat) { if (b.ArrayPosition == i) { boatArray[i] = b; break; } } if (b is Sailboat) { if (b.ArrayPosition == i) { boatArray[i] = b; break; } } if (b is Catamaran) { if (b.ArrayPosition == i) { boatArray[i] = b; break; } } } }