- [X] Caches DateTime.NowUtc on the game loop (not other threads) - [X] Replaces all locations where it makes sense - [X] Adds Min/Max for `IComparable` (TimeSpan, DateTimes, etc) Closes #261
21 lines
463 B
C#
21 lines
463 B
C#
using System;
|
|
|
|
namespace Server.Factions
|
|
{
|
|
public class SilverGivenEntry
|
|
{
|
|
public static readonly TimeSpan ExpirePeriod = TimeSpan.FromHours(3.0);
|
|
|
|
public SilverGivenEntry(Mobile givenTo)
|
|
{
|
|
GivenTo = givenTo;
|
|
TimeOfGift = Core.Now;
|
|
}
|
|
|
|
public Mobile GivenTo { get; }
|
|
|
|
public DateTime TimeOfGift { get; }
|
|
|
|
public bool IsExpired => TimeOfGift + ExpirePeriod < Core.Now;
|
|
}
|
|
}
|