Files
Pilz.Dalamud/Pilz.Dalamud/Tools/Strings/StringChanges.cs
2024-07-10 13:40:32 +02:00

33 lines
921 B
C#

namespace Pilz.Dalamud.Tools.Strings;
public class StringChanges
{
private readonly Dictionary<StringPosition, StringChange> changes = [];
public StringChanges()
{
changes.Add(StringPosition.Before, new StringChange());
changes.Add(StringPosition.After, new StringChange());
changes.Add(StringPosition.Replace, new StringChange());
}
/// <summary>
/// Gets a change of the position of your choice where you can add your payloads.
/// </summary>
/// <param name="position">The position of your choice.</param>
/// <returns></returns>
public StringChange GetChange(StringPosition position)
{
return changes[position];
}
/// <summary>
/// Checks if there is any string change listed.
/// </summary>
/// <returns></returns>
public bool Any()
{
return changes.Sum(n => n.Value.Payloads.Count) != 0;
}
}