Revert "Updates Packets & Randomizer (#43)" (#61)

This reverts commit 179cb50557.
This commit is contained in:
Kamron Batman 2019-11-11 08:46:11 -08:00 committed by GitHub
parent 179cb50557
commit c2ecc76457
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
588 changed files with 16260 additions and 10926 deletions

View file

@ -18,46 +18,57 @@
*
***************************************************************************/
using System.Buffers;
using Server.Buffers;
using Server.Collections;
using Server.Network;
namespace Server.Gumps
{
public class GumpAlphaRegion : GumpEntry
{
private static byte[] m_LayoutName = Gump.StringToBuffer("checkertrans");
private int m_Width, m_Height;
private int m_X, m_Y;
public GumpAlphaRegion(int x, int y, int width, int height)
{
X = x;
Y = y;
Width = width;
Height = height;
m_X = x;
m_Y = y;
m_Width = width;
m_Height = height;
}
public int X { get; set; }
public int X
{
get => m_X;
set => Delta(ref m_X, value);
}
public int Y { get; set; }
public int Y
{
get => m_Y;
set => Delta(ref m_Y, value);
}
public int Width { get; set; }
public int Width
{
get => m_Width;
set => Delta(ref m_Width, value);
}
public int Height { get; set; }
public int Height
{
get => m_Height;
set => Delta(ref m_Height, value);
}
public override string Compile(NetState ns) => $"{{ checkertrans {m_X} {m_Y} {m_Width} {m_Height} }}";
public override void AppendTo(ArrayBufferWriter<byte> buffer, ArraySet<string> strings, ref int entries, ref int switches)
public override void AppendTo(NetState ns, IGumpWriter disp)
{
SpanWriter writer = new SpanWriter(buffer.GetSpan(60));
writer.Write(m_LayoutName);
writer.WriteAscii(X.ToString());
writer.Write((byte)0x20); // ' '
writer.WriteAscii(Y.ToString());
writer.Write((byte)0x20); // ' '
writer.WriteAscii(Width.ToString());
writer.Write((byte)0x20); // ' '
writer.WriteAscii(Height.ToString());
writer.Write((byte)0x20); // ' '
writer.Write((byte)0x7D); // '}'
buffer.Advance(writer.WrittenCount);
disp.AppendLayout(m_LayoutName);
disp.AppendLayout(m_X);
disp.AppendLayout(m_Y);
disp.AppendLayout(m_Width);
disp.AppendLayout(m_Height);
}
}
}
}