mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +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
31 lines
1.1 KiB
C#
31 lines
1.1 KiB
C#
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Shared.EntityConditions.Conditions;
|
|
|
|
/// <summary>
|
|
/// Uses the conditions of an <see cref="EntityConditionPrototype"/>.
|
|
/// </summary>
|
|
public sealed partial class NestedCondition : EntityConditionBase<NestedCondition>
|
|
{
|
|
/// <summary>
|
|
/// The condition prototype to use.
|
|
/// </summary>
|
|
[DataField(required: true)]
|
|
public ProtoId<EntityConditionPrototype> Proto;
|
|
|
|
public override string EntityConditionGuidebookText(IPrototypeManager prototype)
|
|
=> prototype.Index(Proto).Condition.EntityConditionGuidebookText(prototype);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Handles <see cref="NestedCondition"/>.
|
|
/// </summary>
|
|
public sealed partial class NestedConditionSystem : EntityConditionSystem<TransformComponent, NestedCondition>
|
|
{
|
|
[Dependency] private SharedEntityConditionsSystem _conditions = default!;
|
|
|
|
protected override void Condition(Entity<TransformComponent> ent, ref EntityConditionEvent<NestedCondition> args)
|
|
{
|
|
args.Result = _conditions.TryCondition(ent, args.Condition.Proto);
|
|
}
|
|
}
|