Support for deep cloning battles and Pokemon

This commit is contained in:
2024-12-29 13:51:59 +01:00
parent b3529fa22f
commit 40803f0269
13 changed files with 356 additions and 12 deletions

View File

@@ -12,7 +12,7 @@ namespace PkmnLib.Dynamic.ScriptHandling;
/// changes. This allows for easily defining generational differences, and add effects that the
/// developer might require.
/// </summary>
public abstract class Script
public abstract class Script : IDeepCloneable
{
internal event Action<Script>? OnRemoveEvent;

View File

@@ -1,5 +1,6 @@
using System.Collections;
using System.Diagnostics.CodeAnalysis;
using PkmnLib.Static.Utils;
namespace PkmnLib.Dynamic.ScriptHandling;
@@ -7,7 +8,7 @@ namespace PkmnLib.Dynamic.ScriptHandling;
/// 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 class ScriptContainer : IEnumerable<ScriptContainer>
public class ScriptContainer : IEnumerable<ScriptContainer>, IDeepCloneable
{
/// <inheritdoc cref="ScriptContainer"/>
public ScriptContainer()