using System.Diagnostics.CodeAnalysis;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
namespace Content.Shared.Preferences.Loadouts.Effects;
///
/// Uses a prototype as a singular effect that can be re-used.
///
public sealed partial class GroupLoadoutEffect : LoadoutEffect
{
[DataField(required: true)]
public ProtoId Proto;
public override bool Validate(HumanoidCharacterProfile profile, RoleLoadout loadout, ICommonSession session, IDependencyCollection collection, [NotNullWhen(false)] out FormattedMessage? reason)
{
var effectsProto = collection.Resolve().Index(Proto);
foreach (var effect in effectsProto.Effects)
{
if (!effect.Validate(profile, loadout, session, collection, out reason))
return false;
}
reason = null;
return true;
}
}