Adds battle history, fixes code style

This commit is contained in:
2024-08-23 09:24:00 +02:00
parent d48889e21a
commit e7dc885afd
21 changed files with 80 additions and 70 deletions

View File

@@ -14,7 +14,6 @@ namespace PkmnLib.Dynamic.ScriptHandling;
/// </summary>
public abstract class Script
{
private bool _markedForDeletion;
private int _suppressCount;
/// <summary>
@@ -24,9 +23,6 @@ public abstract class Script
/// </summary>
public virtual StringKey Name => this.ResolveName();
public bool MarkForDeletion() => _markedForDeletion = true;
public bool IsMarkedForDeletion() => _markedForDeletion;
/// <summary>
/// A script can be suppressed by other scripts. If a script is suppressed by at least one script
/// we will not execute its methods. This should return the number of suppressions on the script.

View File

@@ -52,7 +52,6 @@ public class ScriptContainer : IEnumerable<ScriptContainer>
if (Script is not null)
{
Script.OnRemove();
Script.MarkForDeletion();
}
Script = script;
}
@@ -65,7 +64,6 @@ public class ScriptContainer : IEnumerable<ScriptContainer>
if (Script is not null)
{
Script.OnRemove();
Script.MarkForDeletion();
}
Script = null;
}

View File

@@ -122,7 +122,6 @@ public class ScriptSet : IScriptSet
if (!script.IsEmpty)
{
script.Script.OnRemove();
script.Script.MarkForDeletion();
}
}
_scripts.Clear();