* PROJECT 0 WARNINGS: Resolve `'EntitySystem.Get<T>()' is obsolete` in content * pass entman * dog ass test * webeditor
18 lines
506 B
C#
18 lines
506 B
C#
using System.Linq;
|
|
using Content.Server.Holiday;
|
|
|
|
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;
|
|
}
|
|
}
|