예제 #1
0
 /// <summary>
 /// Instantiate a cooker
 /// </summary>
 /// <param name="toolsStorage"></param>
 public Cooker(int id, Washer washer, Oven oven, Position position)
 {
     this.Id             = id;
     this.ToolsStorage   = ToolsManager.GetInstance();
     this.DevicesStorage = DevicesManager.GetInstance();
     this.WasherEngine   = washer;
     this.OvenCook       = oven;
     this.Position       = position;
     this.IsAvailable    = true;
 }
예제 #2
0
        private void CreateCookers(int nb)
        {
            this.Cookers = new List <Cooker>();
            Oven oven  = new Oven();
            int  space = 0;

            for (int i = 1; i <= nb; i++)
            {
                Position position = new Position(80 + space, 160);
                this.Cookers.Add(new Cooker(i, this.WashMan, oven, position));
                space += 80;
            }
        }