예제 #1
0
파일: Path.cs 프로젝트: BrianZell/MapTools
 private Path(Path source, Position position, decimal distance)
 {
     this.StartPosition = source.StartPosition;
     this.EndPosition = position;
     this.Distance = source.Distance + distance;
     this._pathPositions.AddRange(source._pathPositions.Concat(new [] {position}));
 }
예제 #2
0
 public IEnumerable<Path> FindPath(Position start, decimal distance)
 {
     var newPath = new Path(start);
     var resultDict = new Dictionary<Position, Path> {{newPath.EndPosition, newPath}};
     FindPaths(new Path(start), distance, resultDict);
     return resultDict.Values.Where(x => x.Distance > 0).OrderBy(x => x.Distance);
 }
예제 #3
0
파일: Path.cs 프로젝트: BrianZell/MapTools
 public Path(Position start)
 {
     StartPosition = start;
     EndPosition = start;
     Distance = 0.0M;
 }