public void UpdateSuplly() { Console.WriteLine("Please enter box size and amount (x,y,amount)"); if (double.TryParse(Console.ReadLine(), out double x) && double.TryParse(Console.ReadLine(), out double y) && int.TryParse(Console.ReadLine(), out int amnt)) { manager.UpdateSupply(x, y, amnt); } else { Console.WriteLine("Invalid input"); } }
public UI() { log = new StringBuilder(); timer = new System.Timers.Timer(); timer.Elapsed += new ElapsedEventHandler(OnTimedEvent); timer.Interval = 6000000; timer.Enabled = true; manager = new BoxesManager(this, 40, 6, 5); manager.UpdateSupply(1, 3, 6); manager.UpdateSupply(1, 2.5, 13); Thread.Sleep(5001);//for demonstrating unused boxes removal manager.UpdateSupply(1.6, 2, 10); manager.UpdateSupply(1, 7, 12); manager.UpdateSupply(2, 8, 22); manager.UpdateSupply(3, 3, 1); manager.GetGiftBox(3, 3, out double x, out double y); manager.GetRidOfBoxes(); }
public UnitTest1() { test.UpdateSupply(1, 3, 6); test.UpdateSupply(1, 2.5, 13); test.UpdateSupply(1.6, 2, 10); test.UpdateSupply(1, 7, 12); }