示例#1
0
        public void StartCooldown(VoteManager voteManager, IPlugin plugin, ITaskScheduler taskScheduler)
        {
            InCooldown    = true;
            _cooldownTask = taskScheduler.ScheduleTaskPeriodically(plugin, async() =>
            {
                if (--Cooldown > 0)
                {
                    return;
                }

                await voteManager.ReleaseVote(this);
                taskScheduler.CancelTask(_cooldownTask);
            }, "CooldownVote" + Name, TimeSpan.FromSeconds(1));
        }