コード例 #1
0
 public static ToolsManager GetInstance()
 {
     if (Instance == null)
     {
         Instance = new ToolsManager();
     }
     return(Instance);
 }
コード例 #2
0
ファイル: Washer.cs プロジェクト: pierrethenot/MasterChefInfo
 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);
 }
コード例 #3
0
ファイル: Cooker.cs プロジェクト: pierrethenot/MasterChefInfo
 /// <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;
 }