public static ToolsManager GetInstance() { if (Instance == null) { Instance = new ToolsManager(); } return(Instance); }
private void WashTool(Tool tool) { Console.WriteLine("Washer start washing tool " + tool.Name); Thread.Sleep((int)Math.Round(tool.WashingTime * 60000) / 60); Console.WriteLine("Washer finished washing tool " + tool.Name); this.ToolsToWash.Remove(tool); ToolsManager.GetInstance().ReleaseTool(tool); }
/// <summary> /// Instantiate a cooker /// </summary> /// <param name="toolsStorage"></param> public Cooker(int id, Washer washer, Oven oven) { this.Id = id; this.ToolsStorage = ToolsManager.GetInstance(); this.DevicesStorage = DevicesManager.GetInstance(); this.WasherEngine = washer; this.OvenCook = oven; this.IsAvailable = true; }