package com.tiedup.remake.worldgen;

import java.util.List;
import net.minecraft.world.level.block.state.BlockState;
import org.jetbrains.annotations.Nullable;

/**
 * Configuration for decorative blocks placed in a room theme.
 *
 * <p>Captures corner decorations, wall midpoint blocks, optional special
 * first-corner placement, furniture cluster, and lighting/chain flags.</p>
 *
 * @param cornerDecorations    blocks placed at room corners (each with a Y offset)
 * @param wallMidpointBlocks   blocks placed at wall midpoints
 * @param firstCornerSpecial   optional special block for the first corner only
 * @param furnitureCluster     blocks placed as a furniture group
 * @param useTorchLighting     whether to place torches for lighting
 * @param hasCeilingChain      whether to place ceiling chains
 */
public record DecorationConfig(
    List<PositionedBlock> cornerDecorations,
    List<PositionedBlock> wallMidpointBlocks,
    @Nullable PositionedBlock firstCornerSpecial,
    List<PositionedBlock> furnitureCluster,
    boolean useTorchLighting,
    boolean hasCeilingChain
) {

    /**
     * A block state with positional offsets for placement.
     *
     * @param state   the block state to place
     * @param xOffset horizontal X offset from base position (0 = no offset)
     * @param yOffset vertical offset from the base position
     * @param zOffset horizontal Z offset from base position (0 = no offset)
     */
    public record PositionedBlock(BlockState state, int xOffset, int yOffset, int zOffset) {
        /** Convenience constructor for Y-offset-only blocks (most common case). */
        public PositionedBlock(BlockState state, int yOffset) {
            this(state, 0, yOffset, 0);
        }
    }
}
