diff --git a/.idea/.idea.RobotIntelFinal/.idea/contentModel.xml b/.idea/.idea.RobotIntelFinal/.idea/contentModel.xml
index 31f88f4..579fe2a 100644
--- a/.idea/.idea.RobotIntelFinal/.idea/contentModel.xml
+++ b/.idea/.idea.RobotIntelFinal/.idea/contentModel.xml
@@ -7,10 +7,13 @@
-
+
-
+
+
+
+
@@ -20,6 +23,7 @@
+
diff --git a/.idea/.idea.RobotIntelFinal/.idea/workspace.xml b/.idea/.idea.RobotIntelFinal/.idea/workspace.xml
index 01e4be4..b46b6d1 100644
--- a/.idea/.idea.RobotIntelFinal/.idea/workspace.xml
+++ b/.idea/.idea.RobotIntelFinal/.idea/workspace.xml
@@ -16,10 +16,12 @@
-
+
-
+
+
+
@@ -58,11 +60,13 @@
-
+
+
+
@@ -150,15 +154,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
diff --git a/ConsoleApp/Bootstrapper.cs b/ConsoleApp/Bootstrapper.cs
index 44abf9c..cbc188f 100644
--- a/ConsoleApp/Bootstrapper.cs
+++ b/ConsoleApp/Bootstrapper.cs
@@ -1,7 +1,34 @@
+using DryIoc;
+using System;
+
namespace ConsoleApp
{
- public class Bootstrapper
+ public class BootStrapper
{
- p
+ private static readonly string NoBootstrapperMessage = $"Called {nameof(BootStrapper)} before it existed";
+
+ private static BootStrapper _bootStrapper;
+ private static IContainer _container;
+
+ public static BootStrapper Instance =>
+ _bootStrapper ?? throw new InvalidOperationException(NoBootstrapperMessage);
+
+ public BootStrapper(params IModule[] modules)
+ {
+ _container = new Container();
+ foreach (var module in modules)
+ {
+ module.Register(_container);
+ }
+ foreach (var module in modules)
+ {
+ module.Resolve(_container);
+ }
+ }
+
+ public static BootStrapper BootstrapSystem(params IModule[] modules) =>
+ _bootStrapper = new BootStrapper(modules);
+
+ public T Resolve() => _container.Resolve();
}
}
\ No newline at end of file
diff --git a/ConsoleApp/ISimRunner.cs b/ConsoleApp/ISimRunner.cs
index ab2acb5..35f486b 100644
--- a/ConsoleApp/ISimRunner.cs
+++ b/ConsoleApp/ISimRunner.cs
@@ -2,7 +2,6 @@ namespace ConsoleApp
{
public interface ISimRunner
{
- void GenerateMaps(int x, int y);
- void StartSim();
+ void Run();
}
}
\ No newline at end of file
diff --git a/ConsoleApp/Maps/HexCell.cs b/ConsoleApp/Maps/HexCell.cs
new file mode 100644
index 0000000..961f0f0
--- /dev/null
+++ b/ConsoleApp/Maps/HexCell.cs
@@ -0,0 +1,7 @@
+namespace ConsoleApp
+{
+ public class HexCell
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/ConsoleApp/Maps/HexMap.cs b/ConsoleApp/Maps/HexMap.cs
new file mode 100644
index 0000000..d418b3a
--- /dev/null
+++ b/ConsoleApp/Maps/HexMap.cs
@@ -0,0 +1,7 @@
+namespace ConsoleApp
+{
+ public class HexMap
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/ConsoleApp/Maps/IHexCell.cs b/ConsoleApp/Maps/IHexCell.cs
new file mode 100644
index 0000000..c7a9386
--- /dev/null
+++ b/ConsoleApp/Maps/IHexCell.cs
@@ -0,0 +1,7 @@
+namespace ConsoleApp
+{
+ public interface IHexCell
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/ConsoleApp/Maps/IHexMap.cs b/ConsoleApp/Maps/IHexMap.cs
new file mode 100644
index 0000000..d053d8a
--- /dev/null
+++ b/ConsoleApp/Maps/IHexMap.cs
@@ -0,0 +1,7 @@
+namespace ConsoleApp
+{
+ public interface IHexMap
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/ConsoleApp/Maps/IMapFactory.cs b/ConsoleApp/Maps/IMapFactory.cs
index 474f631..6a81691 100644
--- a/ConsoleApp/Maps/IMapFactory.cs
+++ b/ConsoleApp/Maps/IMapFactory.cs
@@ -7,5 +7,6 @@ namespace ConsoleApp
int Height { get; }
int Width { get; }
SquareMap SquareMap { get; }
+ void GenerateMaps(int x, int y);
}
}
\ No newline at end of file
diff --git a/ConsoleApp/Maps/ISquareCell.cs b/ConsoleApp/Maps/ISquareCell.cs
new file mode 100644
index 0000000..71edc59
--- /dev/null
+++ b/ConsoleApp/Maps/ISquareCell.cs
@@ -0,0 +1,7 @@
+namespace ConsoleApp
+{
+ public interface ISquareCell
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/ConsoleApp/Maps/ISquareMap.cs b/ConsoleApp/Maps/ISquareMap.cs
new file mode 100644
index 0000000..01f3fc7
--- /dev/null
+++ b/ConsoleApp/Maps/ISquareMap.cs
@@ -0,0 +1,7 @@
+namespace ConsoleApp
+{
+ public interface ISquareMap
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/ConsoleApp/Maps/MapFactory.cs b/ConsoleApp/Maps/MapFactory.cs
index 02f5ad4..773f67f 100644
--- a/ConsoleApp/Maps/MapFactory.cs
+++ b/ConsoleApp/Maps/MapFactory.cs
@@ -6,6 +6,16 @@ namespace ConsoleApp
private int _defaultWidth;
public int Height { get; protected set; }
public int Width { get; protected set; }
+ public SquareMap SquareMap { get; }
+ public HexMap HexMap { get; }
+
+
+ public void GenerateMaps(int x, int y)
+ {
+ Width = x;
+ Height = y;
+ throw new System.NotImplementedException();
+ }
public MapFactory()
{
@@ -14,16 +24,6 @@ namespace ConsoleApp
Height = _defaultHeight;
Width = _defaultWidth;
}
-
- void CreateMaps(int height, int width)
- {
- Height = height;
- Width = width;
- }
-
- void CreateMaps()
- {
-
- }
+
}
}
\ No newline at end of file
diff --git a/ConsoleApp/Maps/SquareCell.cs b/ConsoleApp/Maps/SquareCell.cs
new file mode 100644
index 0000000..5adb1b1
--- /dev/null
+++ b/ConsoleApp/Maps/SquareCell.cs
@@ -0,0 +1,7 @@
+namespace ConsoleApp
+{
+ public class SquareCell
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/ConsoleApp/Maps/SquareMap.cs b/ConsoleApp/Maps/SquareMap.cs
new file mode 100644
index 0000000..08e5ee4
--- /dev/null
+++ b/ConsoleApp/Maps/SquareMap.cs
@@ -0,0 +1,7 @@
+namespace ConsoleApp
+{
+ public class SquareMap
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/ConsoleApp/Program.cs b/ConsoleApp/Program.cs
index 24abfa3..300bcee 100644
--- a/ConsoleApp/Program.cs
+++ b/ConsoleApp/Program.cs
@@ -5,9 +5,11 @@ namespace ConsoleApp
class Program
{
private static UserConsole _userConsole;
+ private static BootStrapper _bootstrapper;
static void Main(string[] args)
{
+ _bootstrapper = new BootStrapper();
_userConsole = new UserConsole();
StartSimulation();
}
@@ -30,8 +32,11 @@ namespace ConsoleApp
private static void RunSimulation(int x,int y)
{
- var bootStrapper = new Bootstrapper
- var simRunner = new SimRunner();
+ var simRunner = _bootstrapper.Resolve();
+ var mapFactory = _bootstrapper.Resolve();
+
+ mapFactory.GenerateMaps(x, y);
+ simRunner.Run();
}
}
diff --git a/ConsoleApp/SimRunner.cs b/ConsoleApp/SimRunner.cs
index 5690450..45727e7 100644
--- a/ConsoleApp/SimRunner.cs
+++ b/ConsoleApp/SimRunner.cs
@@ -8,14 +8,8 @@ namespace ConsoleApp
{
_mapFactory = mapFactory;
}
- public void GenerateMaps(int x, int y)
- {
- _mapFactory.GenerateMaps(x, y);
- _mapFactory.SquareMap();
- throw new System.NotImplementedException();
- }
- public void StartSim()
+ public void Run()
{
throw new System.NotImplementedException();
}