public ResourceTypes Execute()
 {
     //Console.WriteLine($"{Owner} : resources are available. Take resources : {needResources}");
     StateLogger.DrawState($"{Owner} : resources are available. Take resources : {needResources}");
     SemaphoreSlim.Release();
     return(needResources);
 }
Пример #2
0
 public override void Run()
 {
     while (Working)
     {
         Thread.Sleep(MinCharmTime + random.Next() % Interval);
         int facId = random.Next() % factories.Length;
         //Console.WriteLine($"{Name} : casts a charm to {factories[facId].Name}");
         factories[facId].AddCharm();
         // Console.WriteLine($"{Name} : Finished");
         StateLogger.DrawState($"{Name} : casted a charm to {factories[facId].Name}");
     }
 }
Пример #3
0
 public override void Run()
 {
     while (Working)
     {
         Thread.Sleep(MinCharmTime + random.Next() % Interval);
         //Console.WriteLine($"{Name} : start taking off the charms");
         foreach (var fac in factories)
         {
             fac.RemoveCharm();
         }
         //Console.WriteLine($"{Name} : Finished");
         StateLogger.DrawState($"{Name} : removed the charms");
     }
 }