using Content.Shared.Damage.Components; namespace Content.Shared.Destructible.Thresholds.Triggers; /// /// A condition for triggering a . /// /// /// I decided against converting these into EntityEffectConditions for performance reasons /// (although I did not do any benchmarks, so it might be fine). /// Entity effects will raise a separate event for each entity and each condition, which can become a huge number /// for cases like nuke explosions or shuttle collisions where there are lots of DamageChangedEvents at once. /// IThresholdTriggers on the other hand are directly checked in a foreach loop without raising events. /// And there are only few of these conditions, so there is only a minor amount of code duplication. /// public interface IThresholdTrigger { /// /// Checks if this trigger has been reached. /// /// The damageable component to check with. /// /// An instance of to pull dependencies from, if any. /// /// true if this trigger has been reached, false otherwise. bool Reached(Entity damageable, SharedDestructibleSystem system); }