package org.typowriter.intellij.plugins.backgroundchibichara.settings;

import org.jetbrains.annotations.NotNull;
import org.typowriter.intellij.plugins.backgroundchibichara.BackgroundImageBorder;

import java.util.ArrayList;
import java.util.List;

public class BackgroundChibiCharaSettings {
    public static final BackgroundChibiCharaSettings DEFAULT = new BackgroundChibiCharaSettings();
    public List<String> filepathList;
    public int alignId;
    public int margin;
    public int spacing;
    public double alpha;

    public BackgroundChibiCharaSettings(List<String> filepathList, BackgroundImageBorder.Align align, int margin, int spacing, double alpha) {
        this.filepathList = filepathList;
        this.alignId = align.id;
        this.margin = margin;
        this.spacing = spacing;
        this.alpha = alpha;
    }

    public BackgroundChibiCharaSettings() {
        this.filepathList = new ArrayList<String>();
        this.alignId = BackgroundImageBorder.Align.RIGHT.id;
        this.margin = 10;
        this.spacing = 30;
        this.alpha = 0.3;
    }

    public BackgroundImageBorder.Align getAlign() {
        return BackgroundImageBorder.Align.getById(this.alignId);
    }

    public List<String> getFilepathList() {
        return new ArrayList<String>(filepathList);
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof BackgroundChibiCharaSettings)) {
            return false;
        }
        BackgroundChibiCharaSettings otherSettings = (BackgroundChibiCharaSettings) obj;
        return filepathList.equals(otherSettings.filepathList)
                & alignId == otherSettings.alignId
                & margin == otherSettings.margin
                & spacing == otherSettings.spacing
                & alpha == otherSettings.alpha;
    }

    public interface Holder {
        @NotNull
        BackgroundChibiCharaSettings getSettings();

        void setSettings(@NotNull BackgroundChibiCharaSettings settings);
    }
}
@@ -1020,9 +1020,9 @@
 n = 
-1
+5
 0;%0A 
@@ -1045,16 +1045,17 @@
 ing = 30
+0
 ;%0A      
@@ -1071,17 +1071,18 @@
 pha = 0.
-3
+15
 ;%0A    %7D%0A

improve default settings