mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 13:37:47 +03:00
18 lines
458 B
C#
18 lines
458 B
C#
using System.Linq;
|
|
using Content.Server.Holiday;
|
|
|
|
namespace Content.Server.Maps.Conditions;
|
|
|
|
public sealed class HolidayMapCondition : GameMapCondition
|
|
{
|
|
[DataField("holidays")]
|
|
public string[] Holidays { get; } = default!;
|
|
|
|
public override bool Check(GameMapPrototype map)
|
|
{
|
|
var holidaySystem = EntitySystem.Get<HolidaySystem>();
|
|
|
|
return Holidays.Any(holiday => holidaySystem.IsCurrentlyHoliday(holiday)) ^ Inverted;
|
|
}
|
|
}
|