Search Results for

    Show / Hide Table of Contents

    Class CustomAbility

    The custom ability base class.

    Inheritance
    System.Object
    CustomAbility
    ActiveAbility
    PassiveAbility
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Exiled.CustomRoles.API.Features
    Assembly: Exiled.CustomRoles.dll
    Syntax
    public abstract class CustomAbility

    Constructors

    | Improve this Doc View Source

    CustomAbility()

    Initializes a new instance of the CustomAbility class.

    Declaration
    public CustomAbility()

    Properties

    | Improve this Doc View Source

    AbilityType

    Gets the System.Type for this ability.

    Declaration
    public string AbilityType { get; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    Description

    Gets or sets the description of the ability.

    Declaration
    public abstract string Description { get; set; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    Name

    Gets or sets the name of the ability.

    Declaration
    public abstract string Name { get; set; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    Players

    Gets all players who have this ability.

    Declaration
    [YamlIgnore]
    public HashSet<Player> Players { get; }
    Property Value
    Type Description
    System.Collections.Generic.HashSet<Player>
    | Improve this Doc View Source

    Registered

    Gets a list of all registered custom abilities.

    Declaration
    public static HashSet<CustomAbility> Registered { get; }
    Property Value
    Type Description
    System.Collections.Generic.HashSet<CustomAbility>

    Methods

    | Improve this Doc View Source

    AbilityAdded(Player)

    Called when the ability is first added to the player.

    Declaration
    protected virtual void AbilityAdded(Player player)
    Parameters
    Type Name Description
    Player player

    The Player using the ability.

    | Improve this Doc View Source

    AbilityRemoved(Player)

    Called when the ability is being removed.

    Declaration
    protected virtual void AbilityRemoved(Player player)
    Parameters
    Type Name Description
    Player player

    The Player using the ability.

    | Improve this Doc View Source

    AddAbility(Player)

    Adds this ability to the player.

    Declaration
    public void AddAbility(Player player)
    Parameters
    Type Name Description
    Player player

    The Player to give the ability to.

    | Improve this Doc View Source

    Check(Player)

    Checks to see if the specified player has this ability.

    Declaration
    public virtual bool Check(Player player)
    Parameters
    Type Name Description
    Player player

    The Player to check.

    Returns
    Type Description
    System.Boolean

    True if the player has this ability.

    | Improve this Doc View Source

    Destroy()

    Destroys this ability.

    Declaration
    public void Destroy()
    | Improve this Doc View Source

    Get(String)

    Gets a CustomAbility by name.

    Declaration
    public static CustomAbility Get(string name)
    Parameters
    Type Name Description
    System.String name

    The name of the ability to get.

    Returns
    Type Description
    CustomAbility

    The ability, or null if it doesn't exist.

    | Improve this Doc View Source

    Get(Type)

    Gets a CustomAbility by type.

    Declaration
    public static CustomAbility Get(Type type)
    Parameters
    Type Name Description
    System.Type type

    The type of the ability to get.

    Returns
    Type Description
    CustomAbility

    The type, or null if it doesn't exist.

    | Improve this Doc View Source

    Init()

    Initializes this ability.

    Declaration
    public void Init()
    | Improve this Doc View Source

    RegisterAbilities(Boolean, Object)

    Registers all the CustomAbility's present in the current assembly.

    Declaration
    public static IEnumerable<CustomAbility> RegisterAbilities(bool skipReflection = false, object overrideClass = null)
    Parameters
    Type Name Description
    System.Boolean skipReflection

    Whether or not reflection is skipped (more efficient if you are not using your custom item classes as config objects).

    System.Object overrideClass

    The class to search properties for, if different from the plugin's config class.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<CustomAbility>

    A System.Collections.Generic.IEnumerable<T> of CustomAbility which contains all registered CustomAbility's.

    | Improve this Doc View Source

    RegisterAbilities(IEnumerable<Type>, Boolean, Boolean, Object)

    Registers all the CustomAbility's present in the current assembly.

    Declaration
    public static IEnumerable<CustomAbility> RegisterAbilities(IEnumerable<Type> targetTypes, bool isIgnored = false, bool skipReflection = false, object overrideClass = null)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.Type> targetTypes

    The System.Collections.Generic.IEnumerable<T> of System.Type containing the target types.

    System.Boolean isIgnored

    A value indicating whether the target types should be ignored.

    System.Boolean skipReflection

    Whether or not reflection is skipped (more efficient if you are not using your custom item classes as config objects).

    System.Object overrideClass

    The class to search properties for, if different from the plugin's config class.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<CustomAbility>

    A System.Collections.Generic.IEnumerable<T> of CustomAbility which contains all registered CustomAbility's.

    | Improve this Doc View Source

    RemoveAbility(Player)

    Removes this ability from the player.

    Declaration
    public void RemoveAbility(Player player)
    Parameters
    Type Name Description
    Player player

    The Player to remove this ability from.

    | Improve this Doc View Source

    SubscribeEvents()

    Loads the internal event handlers for the ability.

    Declaration
    protected virtual void SubscribeEvents()
    | Improve this Doc View Source

    TryGet(String, out CustomAbility)

    Tries to get a CustomAbility by name.

    Declaration
    public static bool TryGet(string name, out CustomAbility customAbility)
    Parameters
    Type Name Description
    System.String name

    The name of the ability to get.

    CustomAbility customAbility

    The custom ability.

    Returns
    Type Description
    System.Boolean

    True if the ability exists.

    Exceptions
    Type Condition
    System.ArgumentNullException

    If the name is null or an empty string.

    | Improve this Doc View Source

    TryGet(Type, out CustomAbility)

    Tries to get a CustomAbility by type.

    Declaration
    public static bool TryGet(Type type, out CustomAbility customAbility)
    Parameters
    Type Name Description
    System.Type type

    The type of the ability to get.

    CustomAbility customAbility

    The custom ability.

    Returns
    Type Description
    System.Boolean

    True if the ability exists, otherwise false.

    | Improve this Doc View Source

    UnregisterAbilities()

    Unregisters all the CustomAbility's present in the current assembly.

    Declaration
    public static IEnumerable<CustomAbility> UnregisterAbilities()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<CustomAbility>

    A System.Collections.Generic.IEnumerable<T> of CustomAbility which contains all unregistered CustomAbility's.

    | Improve this Doc View Source

    UnregisterAbilities(IEnumerable<CustomAbility>, Boolean)

    Unregisters all the CustomAbility's present in the current assembly.

    Declaration
    public static IEnumerable<CustomAbility> UnregisterAbilities(IEnumerable<CustomAbility> targetAbilities, bool isIgnored = false)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<CustomAbility> targetAbilities

    The System.Collections.Generic.IEnumerable<T> of CustomAbility containing the target roles.

    System.Boolean isIgnored

    A value indicating whether the target abilities should be ignored.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<CustomAbility>

    A System.Collections.Generic.IEnumerable<T> of CustomAbility which contains all unregistered CustomAbility's.

    | Improve this Doc View Source

    UnregisterAbilities(IEnumerable<Type>, Boolean)

    Unregisters all the CustomAbility's present in the current assembly.

    Declaration
    public static IEnumerable<CustomAbility> UnregisterAbilities(IEnumerable<Type> targetTypes, bool isIgnored = false)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.Type> targetTypes

    The System.Collections.Generic.IEnumerable<T> of System.Type containing the target types.

    System.Boolean isIgnored

    A value indicating whether the target types should be ignored.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<CustomAbility>

    A System.Collections.Generic.IEnumerable<T> of CustomAbility which contains all unregistered CustomAbility's.

    | Improve this Doc View Source

    UnsubscribeEvents()

    Unloads the internal event handlers for the ability.

    Declaration
    protected virtual void UnsubscribeEvents()

    Extension Methods

    Extensions.Register(CustomAbility)
    Extensions.Unregister(CustomAbility)
    ReflectionExtensions.CopyProperties(Object, Object)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX