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

@@ -3,21 +3,23 @@ using System.Collections.Generic;
namespace ConsoleApp.Maps
{
public class HexMap
public class HexMap : IHexMap
{
private HexCell[,] Map { get; }
public HexMap(int x, int y)
{
Map = new HexCell[x+1,y+1];
for (int r = 0; r < y; r++) {
int r_offset = Convert.ToInt32(Math.Floor(Convert.ToDouble(r)/2));
for (int q = -r_offset; q < x - r_offset; q++) {
for (int q = r_offset; q < x - r_offset; q++) {
// Console.WriteLine($"r:{r}, q:{q}-----x:{x}, y:{y}");
Map[r, q] = new HexCell(q, r, -q-r);
}
}
}
public List<ICell> PossibleMoves(HexCell fromCell, Direction direction, Double orientation)
public List<ICell> PossibleMoves(ICell currentCell)
{
throw new NotImplementedException();
}