From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- Client/Assets/Scripts/XUtliPoolLib/SeqRef.cs | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Client/Assets/Scripts/XUtliPoolLib/SeqRef.cs (limited to 'Client/Assets/Scripts/XUtliPoolLib/SeqRef.cs') diff --git a/Client/Assets/Scripts/XUtliPoolLib/SeqRef.cs b/Client/Assets/Scripts/XUtliPoolLib/SeqRef.cs new file mode 100644 index 00000000..582eebb6 --- /dev/null +++ b/Client/Assets/Scripts/XUtliPoolLib/SeqRef.cs @@ -0,0 +1,39 @@ +using System; + +namespace XUtliPoolLib +{ + public struct SeqRef : ISeqRef, ISeqRef + { + public T this[int key] + { + get + { + return this.bufferRef[(int)this.startOffset + key]; + } + } + + public static CVSReader.ValueParse parser; + + public T[] bufferRef; + + public ushort startOffset; + + public SeqRef(T[] buffer) + { + this.bufferRef = buffer; + this.startOffset = 0; + } + + public void Read(XBinaryReader stream, DataHandler dh) + { + ushort num = stream.ReadUInt16(); + this.bufferRef = SeqRef.parser.GetBuffer(dh); + this.startOffset = num; + } + + public override string ToString() + { + return string.Format("{0}={1}", this[0], this[1]); + } + } +} -- cgit v1.1-26-g67d0