package com.r3944realms.modernlifepatch.content.blocks.type.mirror.shape;

import com.r3944realms.modernlifepatch.content.blocks.type.mirror.MirrorPart;
import net.minecraft.core.Direction;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;

public interface IMirrorShape {
    MirrorShape mirrorShape = new MirrorShape();
    TallMirrorShape tallMirrorShape = new TallMirrorShape();
    LargeMirrorShape largeMirrorShape = new LargeMirrorShape();
    MassiveMirrorShape massiveMirrorShape = new MassiveMirrorShape();
    VoxelShape getDefaultShape(Direction direction);
    VoxelShape getShapeByPart(Direction direction, MirrorPart part);
    MirrorPart.MirrorType getMirrorType();
    default boolean testIsRightPart(@NotNull MirrorPart part) {
        return part.getType() == getMirrorType();
    }
    @Contract(pure = true)
    static IMirrorShape getShapeInstanceByPart(@NotNull MirrorPart part) {
        return switch (part) {
            case SINGLE -> mirrorShape;
            case HEAD, FOOT -> tallMirrorShape;
            case HEAD_LEFT, HEAD_RIGHT, FOOT_LEFT, FOOT_RIGHT -> largeMirrorShape;
            case H00, H01, H02, F10, F11, F12 -> massiveMirrorShape;
        };
    }
}
