Exemplo n.º 1
0
 public SlotGroup(Roaster roaster, Timer timer, Lever lever, int numberOfSlotPerGroup)
 {
     for (int idx = 0; idx < numberOfSlotPerGroup; idx++)
     {
         this.slots.Add(new Slot(roaster, timer, lever));
     }
 }
Exemplo n.º 2
0
 public Slot(Roaster roaster, Timer timer, Lever lever)
 {
     this.roaster = roaster;
     this.lever   = lever;
     timer?.TimeoutHandlers.Add(this);
     lever?.LeverStatusChangedHandlers.Add(this);
 }
Exemplo n.º 3
0
        public Roaster(int numberGroups, int numberOfSlotPerGroup)
        {
            // verify input & count match
            for (int idx = 0; idx < numberGroups; idx++)
            {
                Lever lever = new Lever();
                Timer timer = new Timer(this);
                timer.TimeoutHandlers.Add(lever);
                lever.LeverStatusChangedHandlers.Add(timer);

                SlotGroup group = new SlotGroup(this, timer, lever, numberOfSlotPerGroup);
                this.groups.Add(group);
                this.levers.Add(lever);
                this.timers.Add(timer);
            }
        }