Skip to content
This repository has been archived by the owner on Jan 19, 2025. It is now read-only.

Commit

Permalink
Added more descriptions to serializable properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
NaoUnderscore committed Sep 13, 2024
1 parent 2b57060 commit 62116be
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 50 deletions.
16 changes: 11 additions & 5 deletions Exiled.CustomModules/API/Features/CustomAbilities/CustomAbility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace Exiled.CustomModules.API.Features.CustomAbilities
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;

Expand Down Expand Up @@ -128,31 +129,36 @@ public abstract class CustomAbility<T> : CustomModule, ICustomAbility
[YamlIgnore]
public abstract Type BehaviourComponent { get; }

/// <summary>
/// Gets the ability's settings.
/// </summary>
public virtual AbilitySettings Settings { get; } = AbilitySettings.Default;

/// <summary>
/// Gets or sets the <see cref="CustomAbility{T}"/>'s name.
/// </summary>
[Description("The name of the custom ability.")]
public override string Name { get; set; }

/// <summary>
/// Gets or sets the <see cref="CustomAbility{T}"/>'s id.
/// </summary>
[Description("The id of the custom ability.")]
public override uint Id { get; set; }

/// <summary>
/// Gets or sets a value indicating whether the ability is enabled.
/// </summary>
[Description("Indicates whether the ability is enabled.")]
public override bool IsEnabled { get; set; }

/// <summary>
/// Gets or sets the description of the ability.
/// </summary>
[Description("The description of the custom ability.")]
public virtual string Description { get; set; }

/// <summary>
/// Gets the ability's settings.
/// </summary>
[Description("The settings for the custom ability.")]
public virtual AbilitySettings Settings { get; } = AbilitySettings.Default;

/// <summary>
/// Gets the reflected generic type.
/// </summary>
Expand Down
22 changes: 14 additions & 8 deletions Exiled.CustomModules/API/Features/CustomEscapes/CustomEscape.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace Exiled.CustomModules.API.Features.CustomEscapes
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;

Expand Down Expand Up @@ -63,35 +64,40 @@ public abstract class CustomEscape : CustomModule, IAdditiveBehaviour
[YamlIgnore]
public override ModulePointer Config { get; set; }

/// <summary>
/// Gets the <see cref="CustomEscape"/>'s <see cref="Type"/>.
/// </summary>
[YamlIgnore]
public virtual Type BehaviourComponent { get; }

/// <summary>
/// Gets or sets the <see cref="CustomEscape"/>'s name.
/// </summary>
[Description("The name of the custom escape.")]
public override string Name { get; set; }

/// <summary>
/// Gets or sets or sets the <see cref="CustomEscape"/>'s id.
/// Gets or sets the <see cref="CustomEscape"/>'s id.
/// </summary>
[Description("The id of the custom escape.")]
public override uint Id { get; set; }

/// <summary>
/// Gets or sets a value indicating whether the <see cref="CustomEscape"/> is enabled.
/// </summary>
[Description("Indicates whether the custom escape is enabled.")]
public override bool IsEnabled { get; set; }

/// <summary>
/// Gets the <see cref="CustomEscape"/>'s <see cref="Type"/>.
/// </summary>
[YamlIgnore]
public virtual Type BehaviourComponent { get; }

/// <summary>
/// Gets or sets all <see cref="Hint"/>'s to be displayed based on the relative <see cref="UUEscapeScenarioType"/>.
/// Gets or sets all <see cref="Hint"/>s to be displayed based on the relative <see cref="UUEscapeScenarioType"/>.
/// </summary>
[Description("A dictionary of hints to be displayed based on the scenario type.")]
public virtual Dictionary<byte, Hint> Scenarios { get; set; } = new();

/// <summary>
/// Gets or sets a <see cref="List{T}"/> of <see cref="EscapeSettings"/> containing all escape settings.
/// </summary>
[Description("A list of escape settings, including the default settings.")]
public virtual List<EscapeSettings> Settings { get; set; } = new() { EscapeSettings.Default, };

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace Exiled.CustomModules.API.Features.CustomGameModes
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;

Expand Down Expand Up @@ -74,18 +75,28 @@ public abstract class CustomGameMode : CustomModule, IAdditiveBehaviours
[YamlIgnore]
public static IEnumerable<CustomGameMode> List => Registered;

/// <inheritdoc/>
/// <summary>
/// Gets or sets the <see cref="CustomGameMode"/> name.
/// </summary>
[Description("The name of the game mode.")]
public override string Name { get; set; }

/// <inheritdoc/>
/// <summary>
/// Gets or sets the <see cref="CustomGameMode"/>'s id.
/// </summary>
[Description("The id of the game mode.")]
public override uint Id { get; set; }

/// <inheritdoc/>
/// <summary>
/// Gets or sets a value indicating whether the <see cref="CustomGameMode"/> is enabled.
/// </summary>
[Description("Indicates whether the game mode is enabled.")]
public override bool IsEnabled { get; set; }

/// <summary>
/// Gets or sets the <see cref="GameModeSettings"/>.
/// </summary>
[Description("The settings for the game mode.")]
public virtual GameModeSettings Settings { get; set; }

/// <inheritdoc/>
Expand Down
16 changes: 12 additions & 4 deletions Exiled.CustomModules/API/Features/CustomItems/CustomItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace Exiled.CustomModules.API.Features.CustomItems
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Reflection;
Expand Down Expand Up @@ -88,36 +89,43 @@ public abstract class CustomItem : CustomModule, IAdditiveBehaviour
/// <summary>
/// Gets or sets the <see cref="CustomItem"/>'s name.
/// </summary>
[Description("The name of the custom item.")]
public override string Name { get; set; }

/// <summary>
/// Gets or sets the <see cref="CustomItem"/>'s id.
/// </summary>
[Description("The id of the custom item.")]
public override uint Id { get; set; }

/// <summary>
/// Gets or sets a value indicating whether the <see cref="CustomItem"/> is enabled.
/// Gets or sets the <see cref="CustomItem"/>'s description.
/// </summary>
public override bool IsEnabled { get; set; }
[Description("The description of the custom item.")]
public virtual string Description { get; set; }

/// <summary>
/// Gets or sets the <see cref="CustomItem"/>'s description.
/// Gets or sets a value indicating whether the <see cref="CustomItem"/> is enabled.
/// </summary>
public virtual string Description { get; set; }
[Description("Indicates whether the custom item is enabled.")]
public override bool IsEnabled { get; set; }

/// <summary>
/// Gets or sets the <see cref="CustomItem"/>'s <see cref="global::ItemType"/>.
/// </summary>
[Description("The type of the custom item.")]
public virtual ItemType ItemType { get; set; }

/// <summary>
/// Gets or sets the <see cref="CustomItem"/>'s <see cref="global::ItemCategory"/>.
/// </summary>
[Description("The category of the custom item.")]
public virtual ItemCategory ItemCategory { get; set; }

/// <summary>
/// Gets or sets the <see cref="Settings"/>.
/// </summary>
[Description("The settings of the custom item.")]
public virtual SettingsBase Settings { get; set; }

/// <summary>
Expand Down
33 changes: 27 additions & 6 deletions Exiled.CustomModules/API/Features/CustomRoles/CustomRole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace Exiled.CustomModules.API.Features.CustomRoles
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;

Expand Down Expand Up @@ -91,31 +92,37 @@ public abstract class CustomRole : CustomModule, IAdditiveBehaviour
/// <summary>
/// Gets or sets the <see cref="CustomRole"/>'s name.
/// </summary>
[Description("The name of the custom role.")]
public override string Name { get; set; }

/// <summary>
/// Gets or sets the <see cref="CustomRole"/>'s id.
/// </summary>
[Description("The id of the custom role.")]
public override uint Id { get; set; }

/// <summary>
/// Gets or sets the <see cref="CustomRole"/>'s description.
/// </summary>
[Description("The description of the custom role.")]
public virtual string Description { get; set; }

/// <summary>
/// Gets or sets a value indicating whether the <see cref="CustomRole"/> is enabled.
/// </summary>
[Description("Indicates whether the custom role is enabled.")]
public override bool IsEnabled { get; set; }

/// <summary>
/// Gets or sets the <see cref="CustomRole"/>'s <see cref="RoleTypeId"/>.
/// </summary>
[Description("The custom role's RoleTypeId.")]
public virtual RoleTypeId Role { get; set; }

/// <summary>
/// Gets or sets the relative spawn chance of the <see cref="CustomRole"/>.
/// </summary>
[Description("The custom role's spawn chance.")]
public virtual int Probability { get; set; }

/// <summary>
Expand All @@ -124,6 +131,7 @@ public abstract class CustomRole : CustomModule, IAdditiveBehaviour
/// <remarks>
/// This property specifies the required alive team to be eligible for spawning in the <see cref="CustomRole"/>.
/// </remarks>
[Description("The custom role's required team to spawn.")]
public virtual Team RequiredTeamToSpawn { get; set; } = Team.Dead;

/// <summary>
Expand All @@ -132,6 +140,7 @@ public abstract class CustomRole : CustomModule, IAdditiveBehaviour
/// <remarks>
/// This property specifies the required role type for players to be eligible for spawning in the <see cref="CustomRole"/>.
/// </remarks>
[Description("The custom role's required RoleTypeId to spawn.")]
public virtual RoleTypeId RequiredRoleToSpawn { get; set; } = RoleTypeId.None;

/// <summary>
Expand All @@ -140,6 +149,7 @@ public abstract class CustomRole : CustomModule, IAdditiveBehaviour
/// <remarks>
/// This property specifies the required alive custom team to be eligible for spawning in the <see cref="CustomRole"/>.
/// </remarks>
[Description("The custom role's required custom team to spawn.")]
public virtual uint RequiredCustomTeamToSpawn { get; set; }

/// <summary>
Expand All @@ -148,21 +158,19 @@ public abstract class CustomRole : CustomModule, IAdditiveBehaviour
/// <remarks>
/// This property specifies the required custom role for players to be eligible for spawning in the <see cref="CustomRole"/>.
/// </remarks>
[Description("The custom role's required custom role to spawn.")]
public virtual uint RequiredCustomRoleToSpawn { get; set; }

/// <summary>
/// Gets or sets the <see cref="RoleSettings"/>.
/// </summary>
public virtual RoleSettings Settings { get; set; } = RoleSettings.Default;

/// <summary>
/// Gets or sets the <see cref="CustomEscapes.EscapeSettings"/>.
/// </summary>
[Description("The escape settings for the custom role.")]
public virtual List<EscapeSettings> EscapeSettings { get; set; } = new();

/// <summary>
/// Gets or sets a value representing the maximum instances of the <see cref="CustomRole"/> that can be automatically assigned.
/// </summary>
[Description("The maximum number of instances for the custom role.")]
public virtual int MaxInstances { get; set; }

/// <summary>
Expand All @@ -171,31 +179,43 @@ public abstract class CustomRole : CustomModule, IAdditiveBehaviour
/// <remarks>
/// This property specifies the teams the <see cref="CustomRole"/> belongs to.
/// </remarks>
[Description("The required teams for the custom role to win.")]
public virtual Team[] TeamsOwnership { get; set; } = { };

/// <summary>
/// Gets or sets the <see cref="SpawnableTeamType"/> from which to retrieve players for assigning the <see cref="CustomRole"/>.
/// </summary>
[Description("The spawnable team type for assigning players to the custom role.")]
public virtual SpawnableTeamType AssignFromTeam { get; set; } = SpawnableTeamType.None;

/// <summary>
/// Gets or sets the <see cref="RoleTypeId"/> from which to retrieve players for assigning the <see cref="CustomRole"/>.
/// </summary>
[Description("The role type ID for assigning players to the custom role.")]
public virtual RoleTypeId AssignFromRole { get; set; }

/// <summary>
/// Gets or sets all roles to override, preventing the specified roles to spawn.
/// Gets or sets all roles to override, preventing the specified roles from spawning.
/// </summary>
[Description("All roles to override and prevent from spawning.")]
public virtual RoleTypeId[] OverrideScps { get; set; }

/// <summary>
/// Gets or sets a value indicating whether the <see cref="CustomRole"/> should be treated as a separate team unit.
/// </summary>
[Description("Indicates whether the custom role should be treated as a separate team unit.")]
public virtual bool IsTeamUnit { get; set; }

/// <summary>
/// Gets or sets the <see cref="RoleSettings"/>.
/// </summary>
[Description("The role settings associated with the custom role.")]
public virtual RoleSettings Settings { get; set; } = RoleSettings.Default;

/// <summary>
/// Gets or sets a value indicating whether the <see cref="CustomRole"/> should be considered an SCP.
/// </summary>
[Description("Indicates whether the custom role should be considered an SCP.")]
public virtual bool IsScp { get; set; }

/// <summary>
Expand All @@ -214,6 +234,7 @@ public abstract class CustomRole : CustomModule, IAdditiveBehaviour
/// <summary>
/// Gets all the instances of this <see cref="CustomRole"/> in the global context.
/// </summary>
[YamlIgnore]
public int GlobalInstances { get; private set; }

/// <summary>
Expand Down
Loading

0 comments on commit 62116be

Please sign in to comment.