Exemplo n.º 1
0
 private void PrintStatistics(IPhilosopherStatisticContext philosopherStatisticContext)
 {
     Console.WriteLine("*++++++++++++++++++++++++++++++++++++++++++++++");
     Console.WriteLine("*Deadlocks: " + philosopherStatisticContext.HasDeadlock + " @ " + philosopherStatisticContext.FirstDeadlockOccured);
     Console.WriteLine("*++++++++++++++++++++++++++++++++++++++++++++++");
     Console.WriteLine("Ranks:");
     foreach (var philosopherStatistic in philosopherStatisticContext.EatRank)
     {
         Console.WriteLine(philosopherStatistic.Key.Name + " eat " + philosopherStatistic.Value + " times.");
     }
     Console.ReadLine();
 }
Exemplo n.º 2
0
 public MealWaiter(IPhilosopherStatisticContext philosopherStatisticContext, ConfigContext configContext)
 {
     _philosopherStatisticContext = philosopherStatisticContext;
     _configContext = configContext;
 }
Exemplo n.º 3
0
 public Application(IRestaurant restaurant, IPhilosopherStatisticContext philosopherStatisticContext, ConfigContext configProvider)
 {
     _restaurant = restaurant;
     _philosopherStatisticContext = philosopherStatisticContext;
     _configProvider = configProvider;
 }