public void ProcessPart(FramePart partToProcess)
 {
     Console.WriteLine($"Processing part {partToProcess.Name}");
     foreach (var joiningPart in partToProcess.JoiningParts)
     {
         var cuttingStrategy = partToProcess.SelectCornerCuttingStrategy(joiningPart);
         Console.Write($"\tProcessing join with {joiningPart.Name}: ");
         cuttingStrategy.Execute();
     }
 }
示例#2
0
 public static void Join(FramePart part1, FramePart part2)
 {
     part1.JoiningParts.Add(part2);
     part2.JoiningParts.Add(part1);
 }
示例#3
0
 public ICornerCuttingStrategy SelectCornerCuttingStrategy(FramePart otherPart) =>
 this.CuttingStrategy.Priority > otherPart.CuttingStrategy.Priority ? this.CuttingStrategy : otherPart.CuttingStrategy;