Created Mine Map and ReactivePlanner

This commit is contained in:
2020-12-15 18:19:07 -07:00
parent 45eca3b572
commit 4edcef4664
24 changed files with 309 additions and 84 deletions

View File

@@ -4,7 +4,7 @@ using System.Threading;
using System.Threading.Tasks;
using ConsoleApp.Maps;
using ConsoleApp.PathPlanners;
using ConsoleApp.Vehicle;
using ConsoleApp.Sim;
using HexCore;
namespace ConsoleApp
@@ -16,20 +16,23 @@ namespace ConsoleApp
private int _cellWidth;
private IPathPlanner _pathPlanner;
private IMineMap _mineMap;
private IReactivePathPlanner _reactivePathPlanner;
public SimRunner(IMapFactory mapFactory, IVehicle vehicle, IPathPlanner pathPlanner)
public SimRunner(IMapFactory mapFactory, IVehicle vehicle, IPathPlanner pathPlanner, IReactivePathPlanner reactivePathPlanner)
{
_cellWidth = mapFactory.CellWidth;
_mapFactory = mapFactory;
_vehicle = vehicle;
_pathPlanner = pathPlanner;
_reactivePathPlanner = reactivePathPlanner;
}
public void Run()
{
_mineMap = _mapFactory.GetMineMap();
SquareSimulation();
HexSimulation();
// while(!squareTask.IsCompleted && !hexTask.IsCompleted){Thread.Sleep(500);}
@@ -41,6 +44,7 @@ namespace ConsoleApp
var hexMap = _mapFactory.GetHexMap();
_vehicle.CurrentHexCell = new Coordinate2D(0, 0, OffsetTypes.OddRowsRight);
var optimalPath = _pathPlanner.GenerateOptimalHexPath(hexMap, _vehicle);
var reactivePath = _reactivePathPlanner.ReactiveHexPath;
}