mirror of
https://github.com/corvax-team/ss14-wl.git
synced 2026-02-14 19:29:57 +01:00
19 lines
533 B
C#
19 lines
533 B
C#
using System.Linq;
|
|
using Content.Server.Holiday;
|
|
using Content.Shared.Maps;
|
|
|
|
namespace Content.Server.Maps.Conditions;
|
|
|
|
public sealed partial class HolidayMapCondition : GameMapCondition
|
|
{
|
|
[DataField("holidays")]
|
|
public string[] Holidays { get; private set; } = default!;
|
|
|
|
public override bool Check(GameMapPrototype map)
|
|
{
|
|
var holidaySystem = IoCManager.Resolve<IEntityManager>().System<HolidaySystem>();
|
|
|
|
return Holidays.Any(holiday => holidaySystem.IsCurrentlyHoliday(holiday)) ^ Inverted;
|
|
}
|
|
}
|