/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by Red Squirrel on Feb-12-2011 07:52:53pm
Filepath: scripts\_custom\mlpackage\Engines\Community Collections\CollectionDecayTimer.cs
Lines of code: 19
***********************************************************/


using System;
using Server;

namespace Server
{
	public class CollectionDecayTimer : Timer
	{
		private IComunityCollection m_Collection;

		public CollectionDecayTimer( IComunityCollection collection, TimeSpan delay ) : base( delay, TimeSpan.FromDays( 1.0 ) )
		{
			m_Collection = collection;
			Priority = TimerPriority.OneMinute;
		}

		protected override void OnTick()
		{		
			if ( m_Collection != null && m_Collection.DailyDecay > 0 )		
				m_Collection.Points -= m_Collection.DailyDecay;
		}
	}
}