rectangleGrid static method
获取矩形区域内的所有六边形坐标
Implementation
static List<HexCoordinate> rectangleGrid(int cols, int rows, bool isPointy) {
final hexes = <HexCoordinate>[];
for (var row = 0; row < rows; row++) {
for (var col = 0; col < cols; col++) {
final hex = isPointy
? HexCoordinate.fromOffsetPointy(col, row)
: HexCoordinate.fromOffsetFlat(col, row);
hexes.add(hex);
}
}
return hexes;
}