public void AddWasteToBin(IWasteBin wasteBin, IWaste waste) { wasteBin.ListBox.Items.Add(waste.Name + " (" + waste.Volume + ")"); wasteBin.FullVolume += waste.Volume; wasteBin.ProgressBar.Value += waste.Volume; wasteBin.OccupancyRate = ((wasteBin.FullVolume * 100) / wasteBin.Capacity); }
public void ResetBox(IWasteBin wasteBin) { wasteBin.FullVolume = 0; wasteBin.OccupancyRate = 0; wasteBin.ProgressBar.Value = 0; wasteBin.ListBox.Items.Clear(); }
public bool AddPaperWaste(IWasteBin wasteBin, IWaste waste) { if (IsPaperWaste(waste) && CheckCapacity(wasteBin, waste)) { AddWasteToBin(wasteBin, waste); PaperWastes.Add(waste.Name); return(true); } return(false); }
public bool CheckCapacity(IWasteBin wasteBin, IWaste waste) { if (wasteBin.FullVolume + waste.Volume < wasteBin.Capacity) { return(true); } else { return(false); } }
public bool Empty(IWasteBin wasteBin) { if (wasteBin.OccupancyRate >= 75) { wasteBin.FullVolume = 0; wasteBin.OccupancyRate = 0; wasteBin.ProgressBar.Value = 0; wasteBin.ListBox.Items.Clear(); return(true); } else { return(false); } }
private void AddBinEmptyingScore(IWasteBin wasteBin) { _score += wasteBin.EmptyingScore; lblScore.Text = _score.ToString(); }