ModernUO/Projects/Server/Gumps/GumpEntry.cs
Kamron Batman 3b413371dc
fix(core): Adds Gump component functionality (#377)
- [X] Adds gump close packet
- [X] Fixes gump tooltip
- [X] Adds new compile/append functions for the new gump packets
2021-01-02 19:08:35 -08:00

35 lines
1 KiB
C#

using System.Buffers;
using Server.Collections;
using Server.Network;
namespace Server.Gumps
{
public abstract class GumpEntry
{
private Gump m_Parent;
public Gump Parent
{
get => m_Parent;
set
{
if (m_Parent != value)
{
m_Parent?.Remove(this);
m_Parent = value;
m_Parent?.Add(this);
}
}
}
public abstract string Compile(NetState ns);
public abstract string Compile(OrderedHashSet<string> strings);
public abstract void AppendTo(NetState ns, IGumpWriter disp);
// TODO: Replace OrderedHashSet with InsertOnlyHashSet, a copy of HashSet that is ReadOnly compatible, but includes
// a public AddIfNotPresent function that returns the index of the element
public abstract void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches);
}
}