private void OnPatternAdded(PathPatternType patternType, List<ContourSegment> topSections, List<ContourSegment> bottomSections) { if (patternType != PathPatternType.Flat) return; ContourSegment section = bottomSections.GetFirst(); Ice ice = GenerateItem<Ice>(); ice.SetSection(section); }
private void OnPatternAdded(PathPatternType patternType, List<ContourSegment> topSections, List<ContourSegment> bottomSections) { patternTypes.Add(patternType); if (SignalPatternAdded != null) SignalPatternAdded(patternType, topSections, bottomSections); }
private void OnPatternAdded(PathPatternType patternType, List<ContourSegment> topSections, List<ContourSegment> bottomSections) { if (patternType == PathPatternType.End) { GenerateItemOnSegment(bottomSections.GetFirst(), 0); } }
private void AddPattern(PathPatternType patternType, PathPattern pattern) { List<ContourSegment> topSections = new List<ContourSegment>(); List<ContourSegment> bottomSections = new List<ContourSegment>(); foreach (ContourPatternStepPair instructionPair in pattern.instructionPairs) { if (instructionPair.topInstruction.stepType == ContourPatternStepType.Straight) { ContourPatternStepStraight topInstruction = (ContourPatternStepStraight)instructionPair.topInstruction; var newSection = topContour.AddStraight(topInstruction.slope, topInstruction.length, topInstruction.bumpify); if (newSection) topSections.Add(newSection); } else if (instructionPair.topInstruction.stepType == ContourPatternStepType.Curve) { ContourPatternStepCurve topInstruction = (ContourPatternStepCurve)instructionPair.topInstruction; var newSections = topContour.AddCurve(topInstruction.targetSlope, topInstruction.radius, topInstruction.bumpify); if (newSections.Count > 0) topSections.AddAll(newSections); } if (instructionPair.bottomInstruction.stepType == ContourPatternStepType.Straight) { ContourPatternStepStraight bottomInstruction = (ContourPatternStepStraight)instructionPair.bottomInstruction; var newSection = bottomContour.AddStraight(bottomInstruction.slope, bottomInstruction.length, bottomInstruction.bumpify); if (newSection) bottomSections.Add(newSection); } else if (instructionPair.bottomInstruction.stepType == ContourPatternStepType.Curve) { ContourPatternStepCurve bottomInstruction = (ContourPatternStepCurve)instructionPair.bottomInstruction; var newSections = bottomContour.AddCurve(bottomInstruction.targetSlope, bottomInstruction.radius, bottomInstruction.bumpify); if (newSections.Count > 0) bottomSections.AddAll(newSections); } } OnPatternAdded(patternType, topSections, bottomSections); }