Cleaned up some files
This commit is contained in:
@@ -6,7 +6,7 @@ namespace ConsoleApp.PathPlanners
|
||||
{
|
||||
public class PathPlanner : IPathPlanner
|
||||
{
|
||||
public Queue<ICell> GenerateOptimalSquarePath(SquareMap map, IVehicle vehicle)
|
||||
public Queue<ICell> GenerateOptimalSquarePath(ISquareMap map, IVehicle vehicle)
|
||||
{
|
||||
var path = new Queue<ICell>();
|
||||
var myCell = map.StartingCell;
|
||||
@@ -20,13 +20,13 @@ namespace ConsoleApp.PathPlanners
|
||||
if (availableMoves.Contains(GlobalDirection.North) && currentHeading == GlobalDirection.North &&
|
||||
myCell.Y != map.Height)
|
||||
{
|
||||
path.Enqueue(map[myCell.X, myCell.Y + 1]);
|
||||
myCell = map[myCell.X, myCell.Y + 1];
|
||||
path.Enqueue(map.GetCell(myCell.X, myCell.Y + 1));
|
||||
myCell = map.GetCell(myCell.X, myCell.Y + 1);
|
||||
}
|
||||
else if (availableMoves.Contains(GlobalDirection.South) && currentHeading == GlobalDirection.South && myCell.Y != 0)
|
||||
{
|
||||
path.Enqueue(map[myCell.X, myCell.Y - 1]);
|
||||
myCell = map[myCell.X, myCell.Y - 1];
|
||||
path.Enqueue(map.GetCell(myCell.X, myCell.Y - 1));
|
||||
myCell = map.GetCell(myCell.X, myCell.Y - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -38,9 +38,9 @@ namespace ConsoleApp.PathPlanners
|
||||
{
|
||||
for (int i = myCell.X; i < myCell.X + swathOffset; i++)
|
||||
{
|
||||
path.Enqueue(map[i, myCell.Y]);
|
||||
path.Enqueue(map.GetCell(i, myCell.Y));
|
||||
}
|
||||
myCell = map[myCell.X+swathOffset, myCell.Y];
|
||||
myCell = map.GetCell(myCell.X+swathOffset, myCell.Y);
|
||||
if (currentHeading == GlobalDirection.North)
|
||||
currentHeading = GlobalDirection.South;
|
||||
else if (currentHeading == GlobalDirection.South)
|
||||
@@ -52,7 +52,7 @@ namespace ConsoleApp.PathPlanners
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
|
||||
public Queue<ICell> GenerateOptimalHexPath(HexMap hexMap, IVehicle vehicle)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
||||
Reference in New Issue
Block a user