package com.loganmagnan.eventcore.managers;

import com.loganmagnan.eventcore.EventCore;
import lombok.Getter;
import lombok.Setter;
import java.util.*;

@Getter
@Setter
public class CooldownManager {

    private EventCore main = EventCore.getInstance();

    private Set<UUID> chatCooldown = new HashSet<UUID>();

    private Map<UUID, Integer> chatCooldownTime = new HashMap<UUID, Integer>();

    private int chatCooldownCount;

    public int getChatCooldownTime(UUID player) {
        return this.chatCooldownTime.get(player);
    }

    public void setChatCooldown(UUID player, int number) {
        this.chatCooldown.add(player);
        this.chatCooldownTime.put(player, number);
    }

    public void setChatCooldownTime(UUID player, int time) {
        this.chatCooldownTime.remove(player);
        this.chatCooldownTime.put(player, time);
    }

    public boolean isOnChatCooldown(UUID player) {
        return this.chatCooldown.contains(player);
    }
}
