Backup
Working through some localization stuff will probably be pretty fluid.
This commit is contained in:
@@ -5,16 +5,27 @@ namespace ConsoleApp.Maps
|
||||
{
|
||||
public class SquareMap : ISquareMap
|
||||
{
|
||||
public SquareCell[,] Map { get;}
|
||||
public Cell[,] Map { get;}
|
||||
public ICell StartingCell { get; }
|
||||
public ICell LastCell { get; }
|
||||
|
||||
public SquareMap(int x, int y)
|
||||
{
|
||||
Map = new SquareCell[x,y];
|
||||
//convert to cm
|
||||
x *= 100;
|
||||
y *= 100;
|
||||
//calculate number of cells on x and y axis
|
||||
var xCellCount = (int)Math.Ceiling((decimal) (x) / 25);
|
||||
var yCellCount = (int)Math.Ceiling((decimal) (y) / 25);
|
||||
|
||||
//set last cell;
|
||||
StartingCell = Map[0, 0];
|
||||
Map = new Cell[xCellCount, yCellCount];
|
||||
for (int i = 0; i < x; i++)
|
||||
{
|
||||
for (int j = 0; j < y; j++)
|
||||
{
|
||||
Map[i,j] = new SquareCell(i, j);
|
||||
Map[i,j] = new Cell(i, j);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user