mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
20 lines
726 B
C#
20 lines
726 B
C#
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Shared.EntityConditions;
|
|
|
|
/// <summary>
|
|
/// Entity condition API counterpart using <see cref="EntityConditionPrototype"/> instead of <see cref="EntityCondition"/>.
|
|
/// </summary>
|
|
public sealed partial class SharedEntityConditionsSystem
|
|
{
|
|
[Dependency] private IPrototypeManager _proto = default!;
|
|
|
|
/// <summary>
|
|
/// <c>TryCondition</c> overload that uses a <see cref="EntityConditionPrototype"/> instead of <see cref="EntityCondition"/>.
|
|
/// </summary>
|
|
public bool TryCondition(EntityUid target, [ForbidLiteral] ProtoId<EntityConditionPrototype> id)
|
|
{
|
|
var proto = _proto.Index(id);
|
|
return TryCondition(target, proto.Condition);
|
|
}
|
|
}
|