AStar/astar/Route.cs

37 lines
941 B
C#
Raw Normal View History

2022-11-03 19:14:14 +01:00
using Graph;
namespace astar
{
public class Route
{
public List<Step> steps { get; }
2022-11-13 14:02:27 +01:00
public bool routeFound { get; }
public float distance { get; }
public float time { get; }
2022-11-03 19:14:14 +01:00
2022-11-13 14:02:27 +01:00
public Route(List<Step> steps, bool routeFound, float distance, float timeRequired)
2022-11-03 19:14:14 +01:00
{
2022-11-13 14:02:27 +01:00
this.steps = steps;
this.routeFound = routeFound;
this.distance = distance;
this.time = timeRequired;
2022-11-03 19:14:14 +01:00
}
}
public struct Step
{
public Node start { get; }
public Edge edge { get; }
2022-11-13 14:02:27 +01:00
public float timeRequired { get; }
public float goalDistance { get; }
public Step(Node start, Edge route, float timeRequired, float goalDistance)
2022-11-03 19:14:14 +01:00
{
this.start = start;
this.edge = route;
2022-11-13 14:02:27 +01:00
this.timeRequired = timeRequired;
this.goalDistance = goalDistance;
2022-11-03 19:14:14 +01:00
}
}
}