CooldownManager

Manages cooldowns for different actions performed by players. This class allows tracking, starting, checking, retrieving, and removing cooldowns per action and player.

Functions

Link copied to clipboard

Clears all cooldowns for all actions and players.

Link copied to clipboard
fun getCooldown(action: String, player: String): Cooldown?

Retrieves the cooldown object for a specific action and player.

Link copied to clipboard
fun isCooldownActive(action: String, player: String): Boolean

Checks if a cooldown is active for a specific action and player. If the cooldown has expired, it is removed from the system.

Link copied to clipboard
fun removeCooldown(action: String, player: String)

Removes an active cooldown for a specific action and player.

Link copied to clipboard
fun startCooldown(action: String, player: String, duration: Double)

Starts a cooldown for a specific action and player.