Maps are more generic as well as cells.

This commit is contained in:
2020-12-10 20:34:45 -07:00
parent 7f0cb10198
commit d725372ffb
14 changed files with 121 additions and 94 deletions

View File

@@ -1,3 +1,5 @@
using System.Collections.Generic;
namespace ConsoleApp.Maps
{
public class MapFactory : IMapFactory
@@ -6,15 +8,16 @@ namespace ConsoleApp.Maps
private int _defaultWidth;
public int Height { get; protected set; }
public int Width { get; protected set; }
public SquareMap SquareMap { get; }
public HexMap HexMap { get; }
public Dictionary<string, IMap> Maps { get; }
public void GenerateMaps(int x, int y)
{
Width = x;
Height = y;
new SquareMap(x, y);
Maps.Add("SquareMap",new SquareMap(x, y));
Maps.Add("HexMap", new HexMap(x, y));
}
public MapFactory()
@@ -23,6 +26,7 @@ namespace ConsoleApp.Maps
_defaultWidth = 0;
Height = _defaultHeight;
Width = _defaultWidth;
Maps = new Dictionary<string, IMap>();
}
}