public GraphicsPath GetPath(Point startPt, Point endPt) { this.Session = Guid.NewGuid(); var startLoc = new CellLocation(startPt.Y, startPt.X).Scale(1.0 / PageRenderOptions.GridSize); var endLoc = new CellLocation(endPt.Y, endPt.X).Scale(1.0 / PageRenderOptions.GridSize); var startCell = this.Table[startLoc.Row, startLoc.Col]; var endCell = this.Table[endLoc.Row, endLoc.Col]; startCell.IsOpen = true; endCell.IsOpen = true; endCell.Parent = startCell; var path = this.GetPath(startCell, endCell); path.AddLine(startPt, startPt); path.Reverse(); path.AddLine(endPt, endPt); return(path); }
public int GetColEffort(CellLocation other) { return(Math.Abs(this.Col - other.Col)); }
public int GetRowEffort(CellLocation other) { return(Math.Abs(this.Row - other.Row)); }