コード例 #1
0
 public Knight(int id, Rostrum rostrum, SleazyBar bar)
 {
     this.rostrum = rostrum;
     this.bar     = bar;
     this.random  = new Random(Guid.NewGuid().GetHashCode());
     this.id      = id;
 }
コード例 #2
0
 private static void InitializeKnights(Rostrum rostrum, SleazyBar bar)
 {
     for (int i = 0; i < Configuration.NumberOfKnights; i++)
     {
         var knight = new Knight(i, rostrum, bar);
         new Thread(() => knight.Run()).Start();
     }
 }