package com.yaohun.demonskills.component;

import com.yaohun.demonskills.api.SkillComponent;
import com.yaohun.demonskills.util.CDTimeAPI;
import org.bukkit.entity.Player;

public class CdTimeComponent implements SkillComponent {

    private final String cdKey;
    private final long cdMillis;

    public CdTimeComponent(String cdKey, long cdMillis) {
        this.cdKey = cdKey;
        this.cdMillis = cdMillis;
    }

    @Override
    public void execute(Player caster) {
        CDTimeAPI.setPlayerCD(caster.getUniqueId(),cdKey,cdMillis);
    }
}
