package net.Chipperfluff.chipi.world.gen;

import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;

import net.Chipperfluff.chipi.world.gen.struct.CorridorEWStructure;
import net.Chipperfluff.chipi.world.gen.struct.CorridorNSStructure;
import net.Chipperfluff.chipi.world.gen.struct.RoomBaseStructure;

public final class WorldMaster {

    private WorldMaster() {}

    public static RoomBaseStructure getDefaultRoom() {
        return new RoomBaseStructure();
    }

    public static CorridorNSStructure getDefaultCorridorNS() {
        return new CorridorNSStructure();
    }

    public static CorridorEWStructure getDefaultCorridorEW() {
        return new CorridorEWStructure();
    }

    public static RoomBaseStructure resolveRoom(DungeonContext ctx) {
        return getDefaultRoom();
    }

    public static CorridorNSStructure resolveCorridorNS(DungeonContext ctx) {
        return getDefaultCorridorNS();
    }

    public static CorridorEWStructure resolveCorridorEW(DungeonContext ctx) {
        return getDefaultCorridorEW();
    }

    public static RoomBaseStructure afterPlaceRoom(DungeonContext ctx) {
        if (ctx.getGridX() == 1 && ctx.getGridY() == 1) {
            ctx.setBlock(new BlockPos(9, 1, 8), Blocks.REDSTONE_BLOCK.getDefaultState());
        }
        return getDefaultRoom();
    }

    public static CorridorNSStructure afterPlaceCorridorNS(DungeonContext ctx) {
        return getDefaultCorridorNS();
    }

    public static CorridorEWStructure afterPlaceCorridorEW(DungeonContext ctx) {
        return getDefaultCorridorEW();
    }
}
