using Content.Shared.Whitelist; using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.Actions; /// /// Used on action entities to define an action that triggers when targeting an entity or entity coordinates. /// [RegisterComponent, NetworkedComponent] public sealed partial class EntityWorldTargetActionComponent : BaseTargetActionComponent { public override BaseActionEvent? BaseEvent => Event; /// /// The local-event to raise when this action is performed. /// [DataField] [NonSerialized] public EntityWorldTargetActionEvent? Event; /// /// Determines which entities are valid targets for this action. /// /// No whitelist check when null. [DataField] public EntityWhitelist? Whitelist; /// /// Whether this action considers the user as a valid target entity when using this action. /// [DataField] public bool CanTargetSelf = true; } [Serializable, NetSerializable] public sealed class EntityWorldTargetActionComponentState( EntityWorldTargetActionComponent component, IEntityManager entManager) : BaseActionComponentState(component, entManager) { public EntityWhitelist? Whitelist = component.Whitelist; public bool CanTargetSelf = component.CanTargetSelf; }