Cleaned up some files
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ConsoleApp.Maps
|
||||
@@ -8,18 +9,23 @@ namespace ConsoleApp.Maps
|
||||
private int _defaultWidth;
|
||||
public int Height { get; protected set; }
|
||||
public int Width { get; protected set; }
|
||||
public int CellWidth { get; protected set; }
|
||||
public int CellWidth { get; }
|
||||
|
||||
|
||||
public Dictionary<string, IMap> Maps { get; }
|
||||
|
||||
private ISquareMap _squareMap;
|
||||
|
||||
private IHexMap _hexMap;
|
||||
|
||||
public void GenerateMaps(int x, int y)
|
||||
{
|
||||
Width = x;
|
||||
Height = y;
|
||||
Maps.Add("SquareMap",new SquareMap(x, y));
|
||||
Maps.Add("HexMap", new HexMap(x, y));
|
||||
_squareMap = new SquareMap(x, y);
|
||||
_hexMap = new HexMap(x, y);
|
||||
}
|
||||
public IHexMap GetHexMap() => _hexMap ?? throw new NullReferenceException("hex map not initialized");
|
||||
public ISquareMap GetSquareMap() => _squareMap ?? throw new NullReferenceException("square map not initialized");
|
||||
|
||||
public MapFactory(IVehicle vehicle)
|
||||
{
|
||||
@@ -28,7 +34,8 @@ namespace ConsoleApp.Maps
|
||||
_defaultWidth = 0;
|
||||
Height = _defaultHeight;
|
||||
Width = _defaultWidth;
|
||||
Maps = new Dictionary<string, IMap>();
|
||||
_hexMap = default;
|
||||
_squareMap = default;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user