예제 #1
0
 private void Run()
 {
     while (true)
     {
         lock ( lockObject )
         {
             if (entries.Count == 0)
             {
                 if (!isRunning)
                 {
                     break;
                 }
             }
             else
             {
                 try
                 {
                     var entry = entries.Dequeue();
                     if (targets.HasFlag(Targets.Console))
                     {
                         entry.WriteToConsole();
                     }
                     if (targets.HasFlag(Targets.File))
                     {
                         entry.WriteToFile(id);
                     }
                 }
                 catch (Exception exception)
                 {
                     Console.WriteLine(exception);
                     isRunning = false;
                 }
             }
         }
         Thread.Sleep(10);
     }
 }
예제 #2
0
 /// <summary>
 /// Can this ability target something?
 /// </summary>
 /// <param name="target"></param>
 /// <returns></returns>
 public bool CanTarget(AbilityTargets target)
 {
     return(Targets.HasFlag(target));
 }