Holiday System (#3122)
This commit is contained in:
committed by
GitHub
parent
857c65d968
commit
9ee0ec4106
26
Content.Server/Holiday/ShouldCelebrate/DayOfYear.cs
Normal file
26
Content.Server/Holiday/ShouldCelebrate/DayOfYear.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using Content.Server.Holiday.Interfaces;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Server.Holiday.ShouldCelebrate
|
||||
{
|
||||
/// <summary>
|
||||
/// For a holiday that occurs on a certain day of the year.
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
public class DayOfYear : IHolidayShouldCelebrate
|
||||
{
|
||||
private uint _dayOfYear;
|
||||
|
||||
void IExposeData.ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
serializer.DataField(ref _dayOfYear, "dayOfYear", 1u);
|
||||
}
|
||||
|
||||
public bool ShouldCelebrate(DateTime date, HolidayPrototype holiday)
|
||||
{
|
||||
return date.DayOfYear == _dayOfYear;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user