fix: Removes broken OrderedHashSet and adds a simple OrderedSet (#1756)
> [!CAUTION] > **BREAKING CHANGE** > Removed `OrderdHashSet` and `PooledOrderedHashSet` due to bugs. > [!NOTE] > **Developer Note** > The OrderedSet is not a full data structure. It is not particularly efficient. Pull Requests are welcome for a better implementation, especially if it ends up supporting `ISet<T>` and `IReadOnlySet<T>` ## Summary The ordered hash set was buggy. It's kind of painful to implement, so for now, I added a simple `OrderedSet` to suffice for gumps. Please reach out if this causes disruption!
This commit is contained in:
parent
dc118d836f
commit
4ea1d79cad
30 changed files with 121 additions and 1258 deletions
|
|
@ -45,9 +45,9 @@ public class GumpTextEntry : GumpEntry
|
|||
|
||||
public string InitialText { get; set; }
|
||||
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedSet<string> strings, ref int entries, ref int switches)
|
||||
{
|
||||
var textIndex = strings.GetOrAdd(InitialText ?? "");
|
||||
var textIndex = strings.Add(InitialText ?? "");
|
||||
writer.WriteAscii($"{{ textentry {X} {Y} {Width} {Height} {Hue} {EntryID} {textIndex} }}");
|
||||
entries++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue