/// <summary> /// Checks if this patch can connect to a existing lower patch with: /// - Incoming line left/right /// - Transition form this patch /// </summary> private static bool CheckLowerStepConnection(SfcPatchControl control, bool skippedTransition) { PatchEntity lowerPatch = control.Master.Data.SfcEntity.Lookup(control.Data.X, control.Data.Y + 1); bool hasLowerActiveStep = lowerPatch != null && lowerPatch.SfcStepType != StepType.Unused; if (!hasLowerActiveStep) { return(false); } if (skippedTransition || control.Data.ContainsTransition()) { return(true); } PatchEntity leftPatch = control.Master.Data.SfcEntity.Lookup(control.Data.X - 1, control.Data.Y); return(HasLowerBranchConnection(control.Data, leftPatch)); }
/// <summary> /// Updates the metadata according to the data model. /// </summary> public void UpdatePatch(SfcPatchControl control) { HasPossibleTransitionSkip = CheckPossibleTransitionSkip(control.Master, control.Data); RequestsLowerStepConnection = CheckLowerStepConnection(control, HasPossibleTransitionSkip); }