Ejemplo n.º 1
0
 static void RestockFridge(SmartFridgeManagerImpl fridge, Double fillFactor)
 {
     foreach (Item item in fridge.getItems(fillFactor))
     {
         fridge.handleItemAdded(item.itemType, item.itemUUID, item.name, fillFactor);
     }
 }
Ejemplo n.º 2
0
        static void PrintItemsInFridge(SmartFridgeManagerImpl fridge, Double fillFactor)
        {
            Console.ForegroundColor = ConsoleColor.DarkGreen;

            Console.WriteLine("***** All Items in the fridge *****");
            Console.WriteLine("---------------------------------------------------------------");
            Console.WriteLine("--itemType--itemUUID----name-------------------------fillFactor");
            Console.WriteLine("---------------------------------------------------------------");
            foreach (Item item in fridge.getItems(fillFactor))
            {
                Console.WriteLine("{0} -- {1} -- {2} -- {3}", item.itemType.ToString().PadLeft(5, ' ').PadRight(9, ' '),
                                  item.itemUUID.PadLeft(4, ' ').PadRight(7, ' '),
                                  item.name.PadLeft(1, ' ').PadRight(25, ' '),
                                  item.fillFactor);
            }
            Console.WriteLine("---------------------------------------------------------------");

            Console.ForegroundColor = ConsoleColor.White;
        }