using System; using JetBrains.Annotations; using Robust.Shared.Interfaces.GameObjects; namespace Content.Shared.GameObjects.Verbs { /// /// A verb is an action in the right click menu of an entity. /// Global verbs are visible on all entities, regardless of their components. /// /// /// To add a global verb to all entities, /// define it and mark it with /// public abstract class GlobalVerb : VerbBase { /// /// Gets the visible verb data for the user. /// /// /// Implementations should write into to return their data. /// /// The entity of the user opening this menu. /// The entity this verb is being evaluated for. /// The data that must be filled in. /// The text string that is shown in the right click menu for this verb. public abstract void GetData(IEntity user, IEntity target, VerbData data); /// /// Invoked when this verb is activated from the right click menu. /// /// The entity of the user opening this menu. /// The entity that is being acted upon. public abstract void Activate(IEntity user, IEntity target); public VerbData GetData(IEntity user, IEntity target) { var data = new VerbData(); GetData(user, target, data); return data; } } /// /// This attribute should be used on . These are verbs which are on visible for all entities, /// regardless of the components they contain. /// [MeansImplicitUse] [BaseTypeRequired(typeof(GlobalVerb))] [AttributeUsage(AttributeTargets.Class, Inherited = false)] public sealed class GlobalVerbAttribute : Attribute { } }