Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation update #2680

Open
wants to merge 26 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
667c24b
pawn documentation update
Banalny-Banan Jul 7, 2024
865e2d1
EscapeSettings
Banalny-Banan Jul 7, 2024
dd497f3
EscapeSettings2
Banalny-Banan Jul 7, 2024
e1e59fc
EscapeSettings3
Banalny-Banan Jul 7, 2024
6fe898f
GrenadeSettings
Banalny-Banan Jul 7, 2024
c5bb3d3
GrenadeSettings2
Banalny-Banan Jul 7, 2024
0ff45d7
GrenadeBehaviour and grenade-related EventArgs
Banalny-Banan Jul 7, 2024
b95a0f6
Merge branch 'dev' into documentation-improvements
Misfiy Jul 8, 2024
48e4d0d
Item events
Banalny-Banan Jul 8, 2024
c88b513
cassie events
Banalny-Banan Jul 8, 2024
dbd5d75
Merge remote-tracking branch 'origin/documentation-improvements' into…
Banalny-Banan Jul 8, 2024
130b234
Event{T} (spelling)
Banalny-Banan Jul 8, 2024
510c952
CustomItem
Banalny-Banan Jul 8, 2024
8062845
Grenade events and GrenadeBehaviour
Banalny-Banan Jul 8, 2024
0c0dcae
FakeConnection
Banalny-Banan Jul 9, 2024
3aaed90
EffectType.cs
Banalny-Banan Jul 12, 2024
7ae7187
CustomItem.cs requested changes
Banalny-Banan Jul 12, 2024
e0da413
EffectType.cs
Banalny-Banan Jul 13, 2024
0a6a05f
whether or not → whether
Banalny-Banan Jul 13, 2024
2feb01f
AdminToy and Primitive
Banalny-Banan Jul 13, 2024
f531cca
EffectType.cs r3
Banalny-Banan Jul 13, 2024
d2bc145
Pawn description
Banalny-Banan Jul 13, 2024
31b1ca5
Merge branch 'dev' into documentation-improvements
Banalny-Banan Jul 13, 2024
0ecd084
whether or not → whether 2
Banalny-Banan Jul 14, 2024
3818097
Merge remote-tracking branch 'origin/documentation-improvements' into…
Banalny-Banan Jul 14, 2024
03ab933
whether or not → whether 3
Banalny-Banan Jul 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Exiled.API/Features/Components/FakeConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Exiled.API.Features.Components
using Mirror;

/// <summary>
/// A fake network connection.
/// A fake network connection used for <see cref="Npc"/>.
/// </summary>
public class FakeConnection : NetworkConnectionToClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,13 @@ public EscapeSettings(
}

/// <summary>
/// Gets or sets a value indicating whether escaping is allowed.
/// Gets or sets a value indicating whether the specific settings are enabled.
/// </summary>
public bool IsAllowed { get; set; }

/// <summary>
/// Gets or sets the role to be given when escaping.
/// Will override the <see cref="CustomRole"/> if set.
/// </summary>
public RoleTypeId Role { get; set; }

Expand All @@ -93,12 +94,12 @@ public EscapeSettings(
public CustomRole CustomRole { get; set; }

/// <summary>
/// Gets or sets the escape position.
/// Gets or sets the position where the specific settings will be triggered.
/// </summary>
public Vector3 Position { get; set; }

/// <summary>
/// Gets or sets the maximum allowable distance for applying the specified settings.
/// Gets or sets the distance threshold from the <see cref="Position"/> to trigger the settings.
/// </summary>
public float DistanceThreshold { get; set; }
}
Expand Down
96 changes: 48 additions & 48 deletions Exiled.CustomModules/API/Features/CustomItems/CustomItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Exiled.CustomModules.API.Features.CustomItems
using UnityEngine;

/// <summary>
/// A class to easily manage item behavior.
/// A class to customize item behaviour.
/// </summary>
public abstract class CustomItem : CustomModule, IAdditiveBehaviour
{
Expand All @@ -47,27 +47,27 @@ public abstract class CustomItem : CustomModule, IAdditiveBehaviour
#pragma warning restore SA1202 // Elements should be ordered by access

/// <summary>
/// Gets a <see cref="List{T}"/> which contains all registered <see cref="CustomItem"/>'s.
/// Gets all registered <see cref="CustomItem"/>s.
/// </summary>
public static IEnumerable<CustomItem> List => Registered;

/// <summary>
/// Gets all Items and their respective <see cref="CustomItem"/>.
/// Gets all custom items and their respective <see cref="CustomItem"/> instance.
/// </summary>
public static IReadOnlyDictionary<Item, CustomItem> ItemManager => ItemsValue;

/// <summary>
/// Gets all Pickups and their respective <see cref="CustomItem"/>.
/// Gets all custom pickups and their respective <see cref="CustomItem"/> instance.
/// </summary>
public static IReadOnlyDictionary<Pickup, CustomItem> PickupManager => PickupValue;

/// <summary>
/// Gets all pickups belonging to a <see cref="CustomItem"/>.
/// Gets all pickups that are <see cref="CustomItem"/>s.
/// </summary>
public static HashSet<Pickup> CustomItemsUnhold => PickupManager.Keys.ToHashSet();

/// <summary>
/// Gets all items belonging to a <see cref="CustomItem"/>.
/// Gets all items that are <see cref="CustomItem"/>s.
/// </summary>
public static HashSet<Item> CustomItemsHolded => ItemManager.Keys.ToHashSet();

Expand All @@ -92,7 +92,7 @@ public abstract class CustomItem : CustomModule, IAdditiveBehaviour
public override bool IsEnabled { get; }

/// <summary>
/// Gets the <see cref="CustomItem"/>'s description.
/// Gets the description. It can be is used in hints when the item is selected.
NaoUnderscore marked this conversation as resolved.
Show resolved Hide resolved
/// </summary>
public virtual string Description { get; }

Expand All @@ -117,12 +117,12 @@ public abstract class CustomItem : CustomModule, IAdditiveBehaviour
public virtual bool IsRegistered => Registered.Contains(this);

/// <summary>
/// Gets a <see cref="IEnumerable{T}"/> of <see cref="Pickup"/> containing all pickup owning this <see cref="Pickup"/>.
/// Gets all <see cref="Pickup"/> instances of this <see cref="CustomItem"/>.
/// </summary>
public IEnumerable<Pickup> Pickups => PickupManager.Where(x => x.Value.Id == Id).Select(x => x.Key);

/// <summary>
/// Gets a <see cref="IEnumerable{T}"/> of <see cref="Item"/> containing all item owning this <see cref="CustomItem"/>.
/// Gets all <see cref="Item"/> instances of this <see cref="CustomItem"/>.
/// </summary>
public IEnumerable<Item> Items => ItemsValue.Where(x => x.Value.Id == Id).Select(x => x.Key);

Expand All @@ -134,33 +134,33 @@ public abstract class CustomItem : CustomModule, IAdditiveBehaviour
public static CustomItem Get(object id) => id is uint or UUCustomItemType ? Get((uint)id) : null;

/// <summary>
/// Retrieves a <see cref="CustomItem"/> instance based on the specified custom item id.
/// Gets a <see cref="CustomItem"/> instance based on the specified custom item id.
NaoUnderscore marked this conversation as resolved.
Show resolved Hide resolved
/// </summary>
/// <param name="id">The custom item id to retrieve.</param>
/// <returns>The retrieved <see cref="CustomItem"/> instance if found and enabled; otherwise, <see langword="null"/>.</returns>
/// <param name="id">The id of the custom item to get.</param>
/// <returns>The <see cref="CustomItem"/> instance if found and enabled; otherwise, <see langword="null"/>.</returns>
public static CustomItem Get(uint id) => IdLookupTable[id];

/// <summary>
/// Retrieves a <see cref="CustomItem"/> instance based on the specified item name.
/// Gets a <see cref="CustomItem"/> instance based on the specified item name.
/// </summary>
/// <param name="name">The name of the custom item to retrieve.</param>
/// <returns>The retrieved <see cref="CustomItem"/> instance if found; otherwise, <see langword="null"/>.</returns>
/// <param name="name">The name of the custom item to get.</param>
/// <returns>The <see cref="CustomItem"/> instance if found; otherwise, <see langword="null"/>.</returns>
public static CustomItem Get(string name) => NameLookupTable[name];

/// <summary>
/// Retrieves a <see cref="CustomItem"/> instance based on the specified type.
/// Gets a <see cref="CustomItem"/> instance based on the specified type.
/// </summary>
/// <param name="type">The type to retrieve the custom item for.</param>
/// <returns>The retrieved <see cref="CustomItem"/> instance if found and enabled; otherwise, <see langword="null"/>.</returns>
/// <param name="type">The type to get the custom item for.</param>
/// <returns>The <see cref="CustomItem"/> instance if found and enabled; otherwise, <see langword="null"/>.</returns>
public static CustomItem Get(Type type) =>
typeof(CustomItem).IsAssignableFrom(type) ? TypeLookupTable[type] :
typeof(ItemBehaviour).IsAssignableFrom(type) ? BehaviourLookupTable[type] : null;

/// <summary>
/// Retrieves a <see cref="CustomItem"/> instance based on the specified <see cref="Item"/> instance.
/// Gets a <see cref="CustomItem"/> instance based on the specified <see cref="Item"/> instance.
/// </summary>
/// <param name="item">The <see cref="Item"/> instance to retrieve the custom item from.</param>
/// <returns>The retrieved <see cref="CustomItem"/> instance if found; otherwise, <see langword="null"/>.</returns>
/// <param name="item">The <see cref="Item"/> instance to get the custom item from.</param>
/// <returns>The <see cref="CustomItem"/> instance if found; otherwise, <see langword="null"/>.</returns>
public static CustomItem Get(Item item)
{
CustomItem customItem = default;
Expand All @@ -177,17 +177,17 @@ public static CustomItem Get(Item item)
}

/// <summary>
/// Retrieves a <see cref="CustomItem"/> instance based on the specified <see cref="Pickup"/> instance.
/// Gets a <see cref="CustomItem"/> instance based on the specified <see cref="Pickup"/> instance.
/// </summary>
/// <param name="item">The <see cref="Pickup"/> instance to retrieve the custom item from.</param>
/// <returns>The retrieved <see cref="CustomItem"/> instance if found; otherwise, <see langword="null"/>.</returns>
public static CustomItem Get(Pickup item)
/// <param name="pickup">The <see cref="Pickup"/> instance to get the custom item from.</param>
/// <returns>The <see cref="CustomItem"/> instance if found; otherwise, <see langword="null"/>.</returns>
public static CustomItem Get(Pickup pickup)
{
CustomItem customItem = default;

foreach (KeyValuePair<Pickup, CustomItem> kvp in PickupManager)
{
if (kvp.Key != item)
if (kvp.Key != pickup)
continue;

customItem = kvp.Value;
Expand All @@ -197,50 +197,50 @@ public static CustomItem Get(Pickup item)
}

/// <summary>
/// Attempts to retrieve a <see cref="CustomItem"/> based on the provided id or <see cref="UUCustomItemType"/>.
/// Attempts to get a <see cref="CustomItem"/> based on the provided id or <see cref="UUCustomItemType"/>.
/// </summary>
/// <param name="id">The id or <see cref="UUCustomItemType"/> of the custom item.</param>
/// <param name="customItem">When this method returns, contains the <see cref="CustomItem"/> associated with the specified id, if the id was found; otherwise, <see langword="null"/>.</param>
/// <returns><see langword="true"/> if a <see cref="CustomItem"/> was found; otherwise, <see langword="false"/>.</returns>
public static bool TryGet(object id, out CustomItem customItem) => customItem = Get(id);

/// <summary>
/// Tries to retrieve a <see cref="CustomItem"/> instance based on the specified custom item id.
/// Tries to get a <see cref="CustomItem"/> instance based on the specified custom item id.
/// </summary>
/// <param name="id">The custom item id to retrieve.</param>
/// <param name="customItem">The retrieved <see cref="CustomItem"/> instance, if successful; otherwise, <see langword="null"/>.</param>
/// <returns><see langword="true"/> if the retrieval is successful; otherwise, <see langword="false"/>.</returns>
/// <param name="id">The id of the custom item to get.</param>
/// <param name="customItem">The <see cref="CustomItem"/> instance, if successful; otherwise, <see langword="null"/>.</param>
/// <returns><see langword="true"/> if successful; otherwise, <see langword="false"/>.</returns>
public static bool TryGet(uint id, out CustomItem customItem) => customItem = Get(id);

/// <summary>
/// Tries to retrieve a <see cref="CustomItem"/> instance based on the specified item name.
/// Tries to get a <see cref="CustomItem"/> instance based on the specified item name.
/// </summary>
/// <param name="name">The name of the custom item to retrieve.</param>
/// <param name="customItem">The retrieved <see cref="CustomItem"/> instance, if successful; otherwise, <see langword="null"/>.</param>
/// <returns><see langword="true"/> if the retrieval is successful; otherwise, <see langword="false"/>.</returns>
/// <param name="name">The name of the custom item to get.</param>
/// <param name="customItem">The <see cref="CustomItem"/> instance, if successful; otherwise, <see langword="null"/>.</param>
/// <returns><see langword="true"/> if successful; otherwise, <see langword="false"/>.</returns>
public static bool TryGet(string name, out CustomItem customItem) => customItem = Get(name);

/// <summary>
/// Tries to retrieve a <see cref="CustomItem"/> instance based on the specified <see cref="Item"/> instance.
/// Tries to get a <see cref="CustomItem"/> instance based on the specified <see cref="Item"/> instance.
/// </summary>
/// <param name="item">The <see cref="Item"/> instance to retrieve the custom item for.</param>
/// <param name="customItem">The retrieved <see cref="CustomItem"/> instance, if successful; otherwise, <see langword="null"/>.</param>
/// <returns><see langword="true"/> if the retrieval is successful; otherwise, <see langword="false"/>.</returns>
/// <param name="item">The <see cref="Item"/> instance to get the custom item from.</param>
/// <param name="customItem">The <see cref="CustomItem"/> instance, if successful; otherwise, <see langword="null"/>.</param>
/// <returns><see langword="true"/> if successful; otherwise, <see langword="false"/>.</returns>
public static bool TryGet(Item item, out CustomItem customItem) => customItem = Get(item);

/// <summary>
/// Tries to retrieve a <see cref="CustomItem"/> instance based on the specified <see cref="Pickup"/> instance.
/// Tries to get a <see cref="CustomItem"/> instance based on the specified <see cref="Pickup"/> instance.
/// </summary>
/// <param name="pickup">The <see cref="Pickup"/> instance to retrieve the custom item for.</param>
/// <param name="customItem">The retrieved <see cref="CustomItem"/> instance, if successful; otherwise, <see langword="null"/>.</param>
/// <returns><see langword="true"/> if the retrieval is successful; otherwise, <see langword="false"/>.</returns>
/// <param name="pickup">The <see cref="Pickup"/> instance to get the custom item from.</param>
/// <param name="customItem">The <see cref="CustomItem"/> instance, if successful; otherwise, <see langword="null"/>.</param>
/// <returns><see langword="true"/> if successful; otherwise, <see langword="false"/>.</returns>
public static bool TryGet(Pickup pickup, out CustomItem customItem) => customItem = Get(pickup);

/// <summary>
/// Tries to retrieve a <see cref="CustomItem"/> instance based on the specified type.
/// Tries to get a <see cref="CustomItem"/> instance based on the specified type.
/// </summary>
/// <param name="type">The type to retrieve the custom item for.</param>
/// <param name="customItem">The retrieved <see cref="CustomItem"/> instance, if successful; otherwise, <see langword="null"/>.</param>
/// <param name="type">The type to get the custom item for.</param>
/// <param name="customItem">The <see cref="CustomItem"/> instance, if successful; otherwise, <see langword="null"/>.</param>
/// <returns><see langword="true"/> if the retrieval is successful; otherwise, <see langword="false"/>.</returns>
public static bool TryGet(Type type, out CustomItem customItem) => customItem = Get(type);

Expand Down Expand Up @@ -370,7 +370,7 @@ public static bool TryGive(Player player, Type type, bool displayMessage = true)
/// </summary>
/// <param name="assembly">The assembly to enable the items from.</param>
/// <returns>
/// A <see cref="List{T}"/> of <see cref="CustomItem"/> containing all the enabled custom items.
/// A <see cref="List{T}"/> of all the enabled custom items.
/// </returns>
/// <remarks>
/// This method dynamically enables all custom items found in the calling assembly. Custom items
Expand Down Expand Up @@ -408,7 +408,7 @@ public static List<CustomItem> EnableAll(Assembly assembly)
/// Disables all the custom items present in the assembly.
/// </summary>
/// <returns>
/// A <see cref="List{T}"/> of <see cref="CustomItem"/> containing all the disabled custom items.
/// A <see cref="List{T}"/> of all the disabled custom items.
/// </returns>
/// <remarks>
/// This method dynamically disables all custom items found in the calling assembly that were
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace Exiled.CustomModules.API.Features.CustomItems.Items.Explosives
/// </remarks>
public abstract class GrenadeBehaviour : ItemBehaviour
{
/// <inheritdoc cref="ItemBehaviour.Settings"/>.
/// <inheritdoc cref="ItemBehaviour.Settings"/>
public GrenadeSettings GrenadeSettings => Settings.Cast<GrenadeSettings>();

/// <inheritdoc cref="EBehaviour{T}.Owner"/>
Expand All @@ -43,13 +43,13 @@ public abstract class GrenadeBehaviour : ItemBehaviour
/// <summary>
/// Throw the custom grenade object.
/// </summary>
/// <param name="position">The <see cref="Vector3"/> position to throw at.</param>
/// <param name="position">The <see cref="Vector3"/> position to throw from.</param>
/// <param name="force">The amount of force to throw with.</param>
/// <param name="weight">The <see cref="float"/> weight of the Grenade.</param>
/// <param name="fuseTime">The <see cref="float"/> fuse time of the grenade.</param>
/// <param name="grenadeType">The <see cref="ItemType"/> of the grenade to spawn.</param>
/// <param name="player">The <see cref="Player"/> to count as the thrower of the grenade.</param>
/// <returns>The spawned <see cref="Pickup"/>.</returns>
/// <returns>The spawned grenade <see cref="Pickup"/>.</returns>
public virtual Pickup Throw(Vector3 position, float force, float weight, float fuseTime = 3f, ItemType grenadeType = ItemType.GrenadeHE, Player player = null)
{
if (!player)
Expand Down Expand Up @@ -129,31 +129,31 @@ protected override void UnsubscribeEvents()
}

/// <summary>
/// Handles tracking thrown requests by custom grenades.
/// Fired before receiving a throwing request with a custom grenade.
/// </summary>
/// <param name="ev"><see cref="ThrowingRequestEventArgs"/>.</param>
protected virtual void OnThrowingRequest(ThrowingRequestEventArgs ev)
{
}

/// <summary>
/// Handles tracking thrown custom grenades.
/// Fired after a custom grenade is thrown.
/// </summary>
/// <param name="ev"><see cref="ThrownProjectileEventArgs"/>.</param>
protected virtual void OnThrownProjectile(ThrownProjectileEventArgs ev)
{
}

/// <summary>
/// Handles tracking exploded custom grenades.
/// Fired before a custom grenade explodes.
/// </summary>
/// <param name="ev"><see cref="ExplodingGrenadeEventArgs"/>.</param>
protected virtual void OnExploding(ExplodingGrenadeEventArgs ev)
{
}

/// <summary>
/// Handles the tracking of custom grenade pickups that are changed into live grenades by a frag grenade explosion.
/// Fired after a custom <see cref="GrenadePickup"/> was changed into a live grenade by an explosion.
/// </summary>
/// <param name="ev"><see cref="ChangedIntoGrenadeEventArgs"/>.</param>
protected virtual void OnChangedIntoGrenade(ChangedIntoGrenadeEventArgs ev)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ public override ItemType ItemType
}

/// <summary>
/// Gets or sets a value indicating whether gets or sets a value that determines if the grenade should explode immediately when contacting any surface.
/// Gets or sets a value indicating whether the grenade should explode on collision.
/// </summary>
public virtual bool ExplodeOnCollision { get; set; }

/// <summary>
/// Gets or sets a value indicating how long the grenade's fuse time should be.
/// Gets or sets a value indicating the length of grenade's fuse in seconds.
/// </summary>
public virtual float FuseTime { get; set; }
}
Expand Down
Loading