Working through some localization stuff will probably be pretty fluid.
This commit is contained in:
2020-12-14 16:08:59 -07:00
parent 2c5f0b73b9
commit d63066c150
19 changed files with 199 additions and 258 deletions

View File

@@ -1,3 +1,7 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using ConsoleApp.Maps;
namespace ConsoleApp
@@ -5,15 +9,59 @@ namespace ConsoleApp
public class SimRunner : ISimRunner
{
private IMapFactory _mapFactory;
private IVehicle _vehicle;
private IMap _squareMap;
private IMap _hexMap;
private int _cellWidth;
public SimRunner(IMapFactory mapFactory, IVehicle vehicle)
{
_squareMap = mapFactory.Maps["SquareMap"];
_hexMap = mapFactory.Maps["HexMap"];
_cellWidth = mapFactory.CellWidth;
_mapFactory = mapFactory;
_vehicle = vehicle;
}
public void Run()
{
_vehicle.CurrentHexCell = _hexMap.StartingCell;
_vehicle.CurrentSquareCell = _squareMap.StartingCell;
var squareTask = Task.Run(() => SquareSimulation());
var hexTask = Task.Run(() => HexSimulation());
while(!squareTask.IsCompleted && !hexTask.IsCompleted){Thread.Sleep(500);}
}
private void HexSimulation()
{
var optimalPath = GenerateHexPath();
}
private void SquareSimulation()
{
var optimalPath = GenerateSquarePath();
}
private object GenerateSquarePath()
{
throw new NotImplementedException();
}
private Queue<ICell> GenerateHexPath()
{
var path = new Queue<ICell>();
var currentCell = _vehicle.CurrentHexCell;
var possibles = _hexMap.PossibleMoves(currentCell);
while (currentCell != _hexMap.LastCell)
{
}
return path;
}
}
}