using System; using JetBrains.Annotations; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; namespace Content.Shared.Interfaces.GameObjects.Components { /// /// This interface gives components behavior when being activated (by default, /// this is done via the "E" key) when the user is in range and has unobstructed access to the target entity /// (allows inside blockers). This includes activating an object in the world as well as activating an /// object in inventory. Unlike IUse, this can be performed on entities that aren't in the active hand, /// even when the active hand is currently holding something else. /// public interface IActivate { /// /// Called when this component is activated by another entity who is in range. /// void Activate(ActivateEventArgs eventArgs); } public class ActivateEventArgs : EventArgs, ITargetedInteractEventArgs { public IEntity User { get; set; } public IEntity Target { get; set; } } /// /// Raised when an entity is activated in the world. /// [PublicAPI] public class ActivateInWorldMessage : EntitySystemMessage { /// /// If this message has already been "handled" by a previous system. /// public bool Handled { get; set; } /// /// Entity that activated the world entity. /// public IEntity User { get; } /// /// Entity that was activated in the world. /// public IEntity Activated { get; } public ActivateInWorldMessage(IEntity user, IEntity activated) { User = user; Activated = activated; } } }