public static void AddCooldown(string name) { DockingCooldownItem item = new DockingCooldownItem(); item.Start = DateTime.Now; item.Name = name; lock (m_cooldownItems) m_cooldownItems.Add(item); }
public static void AddCooldown(string name) { DockingCooldownItem item = new DockingCooldownItem(); item.Start = DateTime.Now; item.Name = name; lock (m_cooldownItems) m_cooldownItems.Add(item); }
public static bool CheckCooldown(string name) { lock (m_cooldownItems) { DockingCooldownItem item = m_cooldownItems.FindAll(x => x.Name == name).FirstOrDefault(); if (item != null) { if (DateTime.Now - item.Start > TimeSpan.FromSeconds(15)) { m_cooldownItems.RemoveAll(x => x.Name == name); return(true); } else { return(false); } } } return(true); }