import { getBiomelessBlockTransformation, BLOCK_INFECT_TRANSFORMATION_MAP } from './transformations/index';
import { loadRules } from './rules/rules';
import { Biome } from './chunk';
import * as terrainRules from './rules/terrain';
import * as treesRules from './rules/trees';
import * as plantsRules from './rules/plants';
import * as structuresRules from './rules/structures';
import * as desertRules from './rules/biomes/desert';
import * as jungleRules from './rules/biomes/jungle';
import * as mangroveRules from './rules/biomes/mangrove';
import * as savannahRules from './rules/biomes/savannah';
loadRules(terrainRules.default, BLOCK_INFECT_TRANSFORMATION_MAP);
loadRules(treesRules.default, BLOCK_INFECT_TRANSFORMATION_MAP);
loadRules(plantsRules.default, BLOCK_INFECT_TRANSFORMATION_MAP);
loadRules(structuresRules.default, BLOCK_INFECT_TRANSFORMATION_MAP);
loadRules(desertRules.default, BLOCK_INFECT_TRANSFORMATION_MAP, Biome.DESERT);
loadRules(jungleRules.default, BLOCK_INFECT_TRANSFORMATION_MAP, Biome.JUNGLE);
loadRules(jungleRules.default, BLOCK_INFECT_TRANSFORMATION_MAP, Biome.TAIGA);
loadRules(mangroveRules.default, BLOCK_INFECT_TRANSFORMATION_MAP, Biome.MANGROVE);
loadRules(savannahRules.default, BLOCK_INFECT_TRANSFORMATION_MAP, Biome.SAVANNAH);
export default function getBlockTransformation(blockName, biome) {
    const map = BLOCK_INFECT_TRANSFORMATION_MAP.get(biome);
    if (map) {
        const transformation = map.get(blockName);
        if (transformation) {
            return transformation;
        }
    }
    if (biome) {
        return getBiomelessBlockTransformation(blockName);
    }
    return undefined;
}
