Exemplo n.º 1
0
 public Component(Node node, Node[] mines, IScorer scorer)
 {
     Id    = Guid.NewGuid();
     Nodes = new List <Node> {
         node
     };
     Score = new ComponentScore(node, mines, scorer);
 }
 public ComponentScore Add(ComponentScore other)
 {
     Mines.AddRange(other.Mines);
     foreach (var score in other.Scores)
     {
         Scores[score.Key] += score.Value;
     }
     SelfScore = Mines.Sum(x => Scores[x.Id]);
     return(this);
 }