package me.koba1.led.animations;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import me.koba1.led.model.colors.AnimationColor;
import me.koba1.led.model.colors.AnimationColorType;

import java.util.HashMap;
import java.util.Map;

@Setter
@Getter
@ToString
public abstract class ColoredAnimation extends BaseAnimation {

    protected Map<AnimationColorType, AnimationColor> colors;

    public ColoredAnimation(int id) {
        super(id);
        this.colors = new HashMap<>();
    }

    public ColoredAnimation(int id, Map<AnimationColorType, AnimationColor> colors) {
        super(id);
        this.colors = colors;
    }

    public AnimationColor getColor(AnimationColorType key) {
        return colors.getOrDefault(key, new AnimationColor());
    }
}
