Exemplo n.º 1
0
        public void RightHandedEaterGetsFood(Philosopher eater, TakeBitEventArgs e)
        {
            eater.RightChopstick.WaitOne();
            eater.LeftChopstick.WaitOne();

            Eat(eater);
            eater.RightChopstick.Set();
            eater.LeftChopstick.Set();
        }
Exemplo n.º 2
0
        public void RightHandedEaterGetsFood(Philosopher eater, TakeBitEventArgs e)
        {

            eater.RightChopstick.WaitOne();
            eater.LeftChopstick.WaitOne();

            Eat(eater);
            eater.RightChopstick.Set();
            eater.LeftChopstick.Set();



        }
Exemplo n.º 3
0
 protected virtual void OnTakeBiteEvent(Philosopher eater, TakeBitEventArgs e)
 {
     TakeBiteEvent?.Invoke(eater, e);
 }
Exemplo n.º 4
0
 public void Eat(TakeBitEventArgs e)
 {
     IsEating = true;
     EatFromTable?.Invoke(this, e);
 }
Exemplo n.º 5
0
 protected virtual void OnTakeBiteEvent(Philosopher eater, TakeBitEventArgs e)
 {
     TakeBiteEvent?.Invoke(eater, e);
 }
Exemplo n.º 6
0
 public void Eat(TakeBitEventArgs e)
 {
     IsEating = true;
     EatFromTable?.Invoke(this, e);
 }