DayOfYear.cs 568 B

123456789101112131415161718192021
  1. using Content.Server.Holiday.Interfaces;
  2. using JetBrains.Annotations;
  3. namespace Content.Server.Holiday.ShouldCelebrate
  4. {
  5. /// <summary>
  6. /// For a holiday that occurs on a certain day of the year.
  7. /// </summary>
  8. [UsedImplicitly]
  9. [DataDefinition]
  10. public sealed partial class DayOfYear : IHolidayShouldCelebrate
  11. {
  12. [DataField("dayOfYear")]
  13. private uint _dayOfYear = 1;
  14. public bool ShouldCelebrate(DateTime date, HolidayPrototype holiday)
  15. {
  16. return date.DayOfYear == _dayOfYear;
  17. }
  18. }
  19. }