Beispiel #1
0
        public string Bins()
        {
            // Get all of the possible bin collections
            List <RubbishBin> binCollections = binData.GetBinCollections();

            // Get the closest bin collection to today
            RubbishBin closestBinCollection = binLogic.FindClosestBinCollection(binCollections);

            // Format return string with info obtained and return
            return(binLogic.FormatBinCollectionString(closestBinCollection));
        }
Beispiel #2
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(this);
     }
 }
Beispiel #3
0
        public string FormatBinCollectionString(RubbishBin closestBinCollection)
        {
            string formattedBinCollectionOutput = string.Empty;

            if (closestBinCollection.CollectionDate != DateTime.MinValue)
            {
                formattedBinCollectionOutput = $"The closest bin collection is {closestBinCollection.CollectionDate.ToString("dd/MM/yyyy")} it is the black bin";
                if (closestBinCollection.IsBlue)
                {
                    formattedBinCollectionOutput += (" and the blue bin.");
                }
                else if (closestBinCollection.IsGreen)
                {
                    formattedBinCollectionOutput += (" and the green bin.");
                }
            }
            else
            {
                formattedBinCollectionOutput = "BinMan doesn't know when your next collection is, consider updating the software to the latest version.";
            }

            return(formattedBinCollectionOutput);
        }
Beispiel #4
0
 //get bin to fill with rubbish, and track how much rubbish it has
 public void FillBin()
 {
     bin = FindObjectOfType <RubbishBin>();
     bin.fillBin();
     rubbishStatus = 3;
 }