diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000..6ef9ce9
Binary files /dev/null and b/.DS_Store differ
diff --git a/.idea/.idea.RobotIntelFinal/.idea/contentModel.xml b/.idea/.idea.RobotIntelFinal/.idea/contentModel.xml
index 1a4249f..64afb13 100644
--- a/.idea/.idea.RobotIntelFinal/.idea/contentModel.xml
+++ b/.idea/.idea.RobotIntelFinal/.idea/contentModel.xml
@@ -7,9 +7,12 @@
+
+
+
@@ -36,6 +39,9 @@
+
+
+
diff --git a/.idea/.idea.RobotIntelFinal/.idea/workspace.xml b/.idea/.idea.RobotIntelFinal/.idea/workspace.xml
index 5c35923..976b0fd 100644
--- a/.idea/.idea.RobotIntelFinal/.idea/workspace.xml
+++ b/.idea/.idea.RobotIntelFinal/.idea/workspace.xml
@@ -15,25 +15,30 @@
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
@@ -57,10 +62,8 @@
-
-
@@ -77,6 +80,14 @@
+
+
+
+
+
+
+
+
@@ -146,7 +157,7 @@
-
+
@@ -171,30 +182,34 @@
-
+
-
+
-
+
+
-
+
-
+
+
-
+
-
+
+
-
+
+
diff --git a/ConsoleApp/ConsoleApp.csproj b/ConsoleApp/ConsoleApp.csproj
index cca39f4..46562ba 100644
--- a/ConsoleApp/ConsoleApp.csproj
+++ b/ConsoleApp/ConsoleApp.csproj
@@ -9,4 +9,10 @@
+
+
+ PreserveNewest
+
+
+
diff --git a/ConsoleApp/CoreModule.cs b/ConsoleApp/CoreModule.cs
index 9829a46..de3521f 100644
--- a/ConsoleApp/CoreModule.cs
+++ b/ConsoleApp/CoreModule.cs
@@ -1,3 +1,4 @@
+using System.Text.Json;
using System.Threading;
using ConsoleApp.Maps;
using DryIoc;
@@ -10,6 +11,8 @@ namespace ConsoleApp
{
container.Register(Reuse.Singleton);
container.Register(Reuse.Singleton);
+ container.Register(Reuse.Singleton);
+ container.Register(Reuse.Singleton);
}
diff --git a/ConsoleApp/IJsonDeserializor.cs b/ConsoleApp/IJsonDeserializor.cs
index 4d79ed9..2b43207 100644
--- a/ConsoleApp/IJsonDeserializor.cs
+++ b/ConsoleApp/IJsonDeserializor.cs
@@ -1,4 +1,7 @@
-$HEADER$namespace $NAMESPACE$
+namespace ConsoleApp
{
- public interface $INTERFACE$ {$END$}
+ public interface IJsonDeserializor
+ {
+ T DeserializeObject(string filePath);
+ }
}
\ No newline at end of file
diff --git a/ConsoleApp/IVehicle.cs b/ConsoleApp/IVehicle.cs
index 4d79ed9..0e26262 100644
--- a/ConsoleApp/IVehicle.cs
+++ b/ConsoleApp/IVehicle.cs
@@ -1,4 +1,9 @@
-$HEADER$namespace $NAMESPACE$
+namespace ConsoleApp
{
- public interface $INTERFACE$ {$END$}
+ public interface IVehicle
+ {
+ int Length { get; }
+ int Width { get; }
+ int DetectorWidth { get; }
+ }
}
\ No newline at end of file
diff --git a/ConsoleApp/JsonDeserializor.cs b/ConsoleApp/JsonDeserializor.cs
index 9b781fd..244832e 100644
--- a/ConsoleApp/JsonDeserializor.cs
+++ b/ConsoleApp/JsonDeserializor.cs
@@ -1,4 +1,15 @@
-$HEADER$namespace $NAMESPACE$
+using System;
+using System.IO;
+using System.Text.Json;
+
+namespace ConsoleApp
{
- public class $CLASS$ {$END$}
+ public class JsonDeserializor : IJsonDeserializor
+ {
+ public T DeserializeObject(string filePath)
+ {
+ var jString = File.ReadAllText(filePath);
+ return JsonSerializer.Deserialize(jString);
+ }
+ }
}
\ No newline at end of file
diff --git a/ConsoleApp/SimRunner.cs b/ConsoleApp/SimRunner.cs
index 4473388..04a2849 100644
--- a/ConsoleApp/SimRunner.cs
+++ b/ConsoleApp/SimRunner.cs
@@ -6,7 +6,7 @@ namespace ConsoleApp
{
private IMapFactory _mapFactory;
- public SimRunner(IMapFactory mapFactory)
+ public SimRunner(IMapFactory mapFactory, IVehicle vehicle)
{
_mapFactory = mapFactory;
}
diff --git a/ConsoleApp/Vehicle.cs b/ConsoleApp/Vehicle.cs
index 9b781fd..b8c254a 100644
--- a/ConsoleApp/Vehicle.cs
+++ b/ConsoleApp/Vehicle.cs
@@ -1,4 +1,24 @@
-$HEADER$namespace $NAMESPACE$
+using System;
+
+namespace ConsoleApp
{
- public class $CLASS$ {$END$}
+ public class Vehicle : IVehicle
+ {
+ public int Length { get; }
+ public int Width { get; }
+
+ public int DetectorOffset { get;}
+ public int DetectorWidth { get;}
+
+ public Vehicle(IJsonDeserializor jsonDeserializor)
+ {
+ var config = jsonDeserializor.DeserializeObject("/Users/brady.bodily/Documents/Repositories/CS5890_Robot_Intelligence/RobotIntelFinal/ConsoleApp/VehicleConfiguration.json");
+ Length = config.Length;
+ Width = config.Width;
+ DetectorWidth = config.DetectorWidth;
+ DetectorOffset = config.DetectorOffset;
+ }
+
+
+ }
}
\ No newline at end of file
diff --git a/ConsoleApp/VehicleConfiguration.cs b/ConsoleApp/VehicleConfiguration.cs
index 9b781fd..2b84226 100644
--- a/ConsoleApp/VehicleConfiguration.cs
+++ b/ConsoleApp/VehicleConfiguration.cs
@@ -1,4 +1,10 @@
-$HEADER$namespace $NAMESPACE$
+namespace ConsoleApp
{
- public class $CLASS$ {$END$}
+ public class VehicleConfiguration
+ {
+ public int Length { get; set; }
+ public int Width { get; set; }
+ public int DetectorWidth { get; set; }
+ public int DetectorOffset { get; set; }
+ }
}
\ No newline at end of file
diff --git a/ConsoleApp/VehicleConfiguration.json b/ConsoleApp/VehicleConfiguration.json
index 0e0dcd2..aaa1b9f 100644
--- a/ConsoleApp/VehicleConfiguration.json
+++ b/ConsoleApp/VehicleConfiguration.json
@@ -1,3 +1,6 @@
{
-
+ "Length": 3,
+ "Width": 2,
+ "DetectorWidth": 3,
+ "DetectorOffset": 1
}
\ No newline at end of file