Add all missing docs

This commit is contained in:
2025-05-03 14:18:12 +02:00
parent 4d5dfd0342
commit 441f5dddaf
40 changed files with 400 additions and 21 deletions

View File

@@ -4,6 +4,10 @@ using PkmnLib.Static.Utils;
namespace PkmnLib.Dynamic.ScriptHandling;
/// <summary>
/// A holder class for a script. This is used so we can cache a list of these, and iterate over them, even when
/// the underlying script changes.
/// </summary>
public interface IReadOnlyScriptContainer : IEnumerable<ScriptContainer>, IDeepCloneable
{
/// <summary>
@@ -17,10 +21,7 @@ public interface IReadOnlyScriptContainer : IEnumerable<ScriptContainer>, IDeepC
public Script? Script { get; }
}
/// <summary>
/// A holder class for a script. This is used so we can cache a list of these, and iterate over them, even when
/// the underlying script changes.
/// </summary>
/// <inheritdoc cref="IReadOnlyScriptContainer"/>
public class ScriptContainer : IReadOnlyScriptContainer
{
/// <inheritdoc cref="ScriptContainer"/>
@@ -73,6 +74,11 @@ public class ScriptContainer : IReadOnlyScriptContainer
return script;
}
/// <summary>
/// Removes the script from this container, but does not call <see cref="Script.OnRemove"/>.
/// Be very careful with this, as it can lead to unexpected behavior. An example of a valid use is Baton-Pass,
/// where scripts are being removed to be added to another Pokemon, so we want them to remain active.
/// </summary>
public void ClearWithoutRemoving()
{
Script = null;