generate static method

WorldMap generate({
  1. required List<MatrixLayer> layers,
  2. required TileModelBuilder builder,
})

Implementation

static WorldMap generate({
  required List<MatrixLayer> layers,
  required TileModelBuilder builder,
}) {
  List<Layer> tileLayers = [];
  int index = 0;
  for (var layer in layers) {
    if (layer.axisInverted) {
      tileLayers.add(
        Layer(
          id: index,
          tiles: _buildInverted(layer.matrix, builder),
        ),
      );
    } else {
      tileLayers.add(
        Layer(
          id: index,
          tiles: _buildNormal(layer.matrix, builder),
        ),
      );
    }
    index++;
  }

  return WorldMap(tileLayers);
}