public Map(int width, int height, IMapGenerator generator) { Width = width; Height = height; _cells = new Cell[width * height]; for (var y = 0; y < Height; y++) { for (var x = 0; x < Width; x++) { var index = GetCellIndex(x, y); _cells[index] = generator.GetCell(new Point(x, y)); } } }