public Box TakeBox(int j) { Box took = CarryingNow[j]; CarryingNow.Remove(took); volumecarrying -= took.volume; return(took); }
public void GroupMyBoxes() { for (int i = 0; i < CarryingNow.Count; i++) { for (int j = i + 1; j < CarryingNow.Count; j++) { if ((CarryingNow[i].adress == CarryingNow[j].adress) && (CarryingNow[j].volume + CarryingNow[i].volume <= 1000)) { CarryingNow[i] = CarryingNow[j] + CarryingNow[i]; CarryingNow.Remove(CarryingNow[j]); j--; } } } }
public Box TakeBox(Box item) { CarryingNow.Remove(item); return(item); }