package com.company.gameobjects.base;

import com.company.gamestates.GameState;
import com.company.graphics.Assets;

import java.awt.image.BufferedImage;

public abstract class Bonus extends GameObject {

    private int multiplierForDamage;
    private int multiplierForScore;
    private int bonusDuration;

    public Bonus(int x,
                 int y,
                 BufferedImage gameObjectIcon,
                 int damageMultiplier,
                 int speedMultiplier,
                 int multiplierForScore,
                 int bonusDuration) {
        super(x, y, Assets.doubleDamageBonus, speedMultiplier);
        this.multiplierForDamage = damageMultiplier;
        this.multiplierForScore = multiplierForScore;
        this.bonusDuration = bonusDuration;

    }

    public int getMultiplierForDamage() {
        return this.multiplierForDamage;
    }

    public int getMultiplierForScore() {
        return this.multiplierForScore;
    }

    public int getBonusDuration() {
        return this.bonusDuration;
    }

    @Override
    public void update() {
        this.setY(this.getY() + this.getSpeed());
        this.getColliderBox().setBounds(
                this.getX(),
                this.getY(),
                this.getObjectIcon().getWidth(),
                this.getObjectIcon().getHeight()
        );

        if (this.collide(GameState.getPlayer().getColliderBox())) {
            GameState.getPlayer().setCurrentBonus(this);
            GameState.getBonusList().remove(this);
        }
    }
}
@@ -635,101 +635,470 @@
 his.
-multiplierForDamage = damageMultiplier;%0A        this.multiplierForScore = multiplierForScore;
+setMultiplierForDamage(damageMultiplier);%0A        this.setMultiplierForScore(multiplierForScore);%0A        this.setBonusDuration(bonusDuration);%0A%0A    %7D%0A%0A    private void setMultiplierForDamage(int multiplierForDamage) %7B%0A        this.multiplierForDamage = multiplierForDamage;%0A    %7D%0A%0A    private void setMultiplierForScore(int multiplierForScore) %7B%0A        this.multiplierForScore = multiplierForScore;%0A    %7D%0A%0A    private void setBonusDuration(int bonusDuration) %7B
 %0A   
@@ -1134,25 +1134,24 @@
 usDuration;%0A
-%0A
     %7D%0A%0A    p

create and using setter