public IPositionateEdge ResolveConflict(IAbsolutePositionateEdge edge) { return(new IPositionateEdgeMock() { Left = this.Left, Right = this.Right }); }
private void AssertAbsoluteEdge(IAbsolutePositionateEdge edge, PlaceType placeType, Type type) { Assert.IsNotNull(edge); Assert.IsInstanceOfType(edge, typeof(AbsoluteEdge)); Assert.IsInstanceOfType(edge, type); Assert.AreEqual(edge.Type, placeType); Assert.IsNotNull(edge.Left); Assert.AreEqual(edge.Left, this.Left); }
public override IPositionateEdge ResolveConflict(IAbsolutePositionateEdge edge) { var cornerEdge = (InCornerEdge)edge; if (cornerEdge.Horizontal != this.Horizontal || cornerEdge.Vertical != this.Vertical) { return(null); } return(this.ResolveConflictWithGivenEdge(edge.Left, new ToLeftEdge())); }
/// <summary> /// Method for adding absolute edges /// </summary> /// <param name="edge"></param> /// <returns>Edge to add into a graph</returns> private IPositionateEdge AddAbsoluteEdge(IAbsolutePositionateEdge edge) { foreach (var absEdge in this.AbsoluteEdges) { if (absEdge.GetType() == edge.GetType()) { // Edge will return us which edge we should add into graph var newEdge = absEdge.ResolveConflict(edge); if (newEdge == null) { continue; } return(newEdge); } } this.AbsoluteEdges.Add(edge); return(edge); }
/// <summary> /// Interface method for resolving conflicts of same type. /// </summary> /// <param name="edge">Edge to resolve</param> /// <returns>New edge connecting elements</returns> public abstract IPositionateEdge ResolveConflict(IAbsolutePositionateEdge edge);
public override IPositionateEdge ResolveConflict(IAbsolutePositionateEdge edge) { return(this.ResolveConflictWithGivenEdge(edge.Left, new ToLeftEdge())); }