package com.sheep.gamegroup.module.find.bean;

import android.text.TextUtils;

import com.sheep.gamegroup.module.find.util.IFilter;

import java.util.Locale;

/**
 * Created by realicing on 2018/12/4.
 * realicing@sina.com
 * 波浪滤镜
 */
public class WaveFilter implements IFilter {

    private String name;
    private String type = "#unpack";

    public WaveFilter(String name) {
        this.name = name;
    }
    private float percent = 0.5f;

    public float getPercent() {
        return percent;
    }

    public WaveFilter setPercent(float percent) {
        this.percent = percent;
        return this;
    }

    public WaveFilter setName(String name) {
        this.name = name;
        return this;
    }

    public String getType() {
        return type;
    }

    public WaveFilter setType(String type) {
        this.type = type;
        return this;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public String getConfig() {
        if(TextUtils.isEmpty(type)){
            return String.format(Locale.CHINA, "@dynamic wave %.1f", percent);
        }
        return String.format(Locale.CHINA, "%s @dynamic wave %.1f", type , percent);
    }
}
