2013-10-28 07:09:42 +00:00
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace Server
|
|
|
|
|
{
|
|
|
|
|
public class CollectionDecayTimer : Timer
|
|
|
|
|
{
|
|
|
|
|
private readonly IComunityCollection m_Collection;
|
|
|
|
|
public CollectionDecayTimer(IComunityCollection collection, TimeSpan delay)
|
|
|
|
|
: base(delay, TimeSpan.FromDays(1.0))
|
|
|
|
|
{
|
2020-04-16 21:29:55 -04:00
|
|
|
m_Collection = collection;
|
|
|
|
|
Priority = TimerPriority.OneMinute;
|
2013-10-28 07:09:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnTick()
|
2020-04-14 14:04:34 -04:00
|
|
|
{
|
2020-04-16 21:29:55 -04:00
|
|
|
if (m_Collection != null && m_Collection.DailyDecay > 0)
|
|
|
|
|
m_Collection.Points -= m_Collection.DailyDecay;
|
2013-10-28 07:09:42 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|