internal Problem(ProblemSync sync)
 {
     Id           = sync.Id;
     Type         = sync.Type;
     Data         = sync.Data;
     State        = sync.State;
     SubProblems  = sync.SubProblems.Select(s => new SubProblem(s)).ToArray();
     AssignedNode = sync.AssignedNode;
 }
 public void AddProblem(ProblemSync message)
 {
     lock (lockObj)
     {
         if (!problems.ContainsKey(message.Id))
         {
             logger.Info($"Adding new problem of type {message.Type} and id {message.Id}.");
             problems.Add(message.Id, new Problem(message));
             counter = Math.Max(counter, message.Id + 1);
         }
     }
 }