package de.thdeg.greiner.superpangworld.graphics.moveable;

import de.thdeg.greiner.superpangworld.gameview.GameView;
import de.thdeg.greiner.superpangworld.graphics.base.Bubble;
import de.thdeg.greiner.superpangworld.graphics.base.CollidableGameObject;

import java.awt.*;
import java.util.ArrayList;
import java.util.Random;

/**
 * The green bubble with special abilities.
 */
public class SpecialBubble extends Bubble {

    /** The pixel art for the bubble */
    private final static String GREEN_BUBBLE =
                    "    GGGG    \n"+
                    "   GWGGGG   \n"+
                    "  GWGGGGGG  \n"+
                    " GWGGGGGGGG \n"+
                    "GWGGGGGGGGGG\n"+
                    "GWGGGGGGGGGG\n"+
                    "GWGGGGGGGGWG\n"+
                    "GGGGGGGGGWWG\n"+
                    " GGGGGGGWWG \n"+
                    "  GGGGGWWG  \n"+
                    "   GGGWWG   \n"+
                    "    GGGG    \n";
    /** Flag if the time is stopped or all bubbles are popped when this bubble gets popped. */
    private Status status;

    /**
     * Create a special bubble with default values.
     *
     * @param gameView the {@link GameView} to display the bubble
     * @param objectsToCollideWith the list of {@link CollidableGameObject} the bubble can collide with
     */
    public SpecialBubble(GameView gameView, ArrayList<CollidableGameObject> objectsToCollideWith) {
        super(gameView,objectsToCollideWith);

        status = Status.FREEZE;

        this.hitBox.width = width-20;
        this.hitBox.height = height-20;
    }

    @Override
    protected void updateHitBoxPosition() {
        hitBox.x = (int) (position.x+10);
        hitBox.y = (int) (position.y+10);
    }

    @Override
    public void addToCanvas() {
        gameView.addBlockImageToCanvas(GREEN_BUBBLE,position.x,position.y,size, rotation);
    }

    @Override
    public void updateStatus() {

    }

    /**
     * Switches the active effect.
     */
    private void switchEffect(){

    }

    /**
     * Activates the current effect.
     */
    private void activateEffect(){

    }

    /**
     * Enumeration to decide if when the bubble is popped the time is stopped or all bubbles are popped.
     */
    private enum Status{
        FREEZE,
        POP
    }
}
