Files
2020-12-16 17:19:25 -07:00

29 lines
932 B
C#

using System.Collections.Generic;
using ConsoleApp.Maps;
using HexCore;
namespace ConsoleApp.Sim
{
public static class DetectionHead
{
public static List<Coordinate2D> GetCoveredCells(
Graph graph,
Coordinate2D centerCoordinate,
int detectorRadius,
int vehicleTurnRadius)
{
var detectorCells = graph.GetRange(centerCoordinate, detectorRadius);
// var vehicleCells = graph.GetRange(centerCoordinate, vehicleTurnRadius);
// foreach (var vehicleCell in vehicleCells)
// {
// detectorCells.Remove(vehicleCell);
// }
return detectorCells;
}
public static List<Cell> GetCoveredCells(
ISquareMap squareMap,
Cell centerCell,
int detectorRadius) => squareMap.GetRange(centerCell, detectorRadius * 2 - detectorRadius%2);
}
}