export default class Bar
{
    #BAR_HEIGHT_MULTIPLIER = 800;

    constructor(
        xPosition,
        yPosition,
        width,
        height,
        color
    )
    {
        this.xPosition = xPosition;
        this.yPosition = yPosition;
        this.width = width;
        this.height = height;
        this.color = color;
    }

    update(microphoneInput)
    {
        this.height = microphoneInput * this.#BAR_HEIGHT_MULTIPLIER;
    }

    draw(context)
    {
        context.fillStyle = this.color;
        context.fillRect(
            this.xPosition,
            this.yPosition,
            this.width,
            this.height
        );
    }
}