Created Mine Map and ReactivePlanner
This commit is contained in:
20
ConsoleApp/Sim/DetectionHead.cs
Normal file
20
ConsoleApp/Sim/DetectionHead.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
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,
|
||||
GlobalDirection direction) => graph.GetRange(centerCoordinate, detectorRadius);
|
||||
|
||||
public static List<Cell> GetCoveredCells(
|
||||
ISquareMap squareMap,
|
||||
Cell centerCell,
|
||||
int detectorRadius) => squareMap.GetRange(centerCell, detectorRadius);
|
||||
}
|
||||
}
|
||||
16
ConsoleApp/Sim/IVehicle.cs
Normal file
16
ConsoleApp/Sim/IVehicle.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using ConsoleApp.Maps;
|
||||
|
||||
namespace ConsoleApp.Sim
|
||||
{
|
||||
public interface IVehicle
|
||||
{
|
||||
int Length { get; }
|
||||
int Width { get; }
|
||||
int DetectorOffset { get;}
|
||||
int DetectorRadius { get;}
|
||||
HexCore.Coordinate2D CurrentHexCell { get; set; }
|
||||
Heading HexHeading { get; set; }
|
||||
Heading SquareHeading { get; set; }
|
||||
ICell CurrentSquareCell { get; set; }
|
||||
}
|
||||
}
|
||||
31
ConsoleApp/Sim/Vehicle.cs
Normal file
31
ConsoleApp/Sim/Vehicle.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using ConsoleApp.Maps;
|
||||
|
||||
namespace ConsoleApp.Sim
|
||||
{
|
||||
public class Vehicle : IVehicle
|
||||
{
|
||||
public int Length { get; }
|
||||
public int Width { get; }
|
||||
|
||||
public int DetectorOffset { get;}
|
||||
public int DetectorRadius { get;}
|
||||
public HexCore.Coordinate2D CurrentHexCell { get; set; }
|
||||
public Heading HexHeading { get; set; }
|
||||
public Heading SquareHeading { get; set; }
|
||||
public ICell CurrentSquareCell { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
public Vehicle(IJsonDeserializor jsonDeserializor)
|
||||
{
|
||||
var config = jsonDeserializor.DeserializeObject<VehicleConfiguration>("/Users/brady.bodily/Documents/Repositories/CS5890_Robot_Intelligence/RobotIntelFinal/ConsoleApp/Sim/VehicleConfiguration.json");
|
||||
Length = config.Length;
|
||||
Width = config.Width;
|
||||
DetectorRadius = config.DetectorRadius;
|
||||
DetectorOffset = config.DetectorOffset;
|
||||
CurrentHexCell = default;
|
||||
CurrentSquareCell = default;
|
||||
}
|
||||
}
|
||||
}
|
||||
10
ConsoleApp/Sim/VehicleConfiguration.cs
Normal file
10
ConsoleApp/Sim/VehicleConfiguration.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace ConsoleApp.Sim
|
||||
{
|
||||
public class VehicleConfiguration
|
||||
{
|
||||
public int Length { get; set; }
|
||||
public int Width { get; set; }
|
||||
public int DetectorRadius { get; set; }
|
||||
public int DetectorOffset { get; set; }
|
||||
}
|
||||
}
|
||||
6
ConsoleApp/Sim/VehicleConfiguration.json
Normal file
6
ConsoleApp/Sim/VehicleConfiguration.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"Length": 3,
|
||||
"Width": 2,
|
||||
"DetectorRadius": 3,
|
||||
"DetectorOffset": 2
|
||||
}
|
||||
Reference in New Issue
Block a user