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/SpriteTable.cs | 182 ++++++++++++++++++++++ 1 file changed, 182 insertions(+) create mode 100644 Client/Assets/Scripts/XUtliPoolLib/SpriteTable.cs (limited to 'Client/Assets/Scripts/XUtliPoolLib/SpriteTable.cs') diff --git a/Client/Assets/Scripts/XUtliPoolLib/SpriteTable.cs b/Client/Assets/Scripts/XUtliPoolLib/SpriteTable.cs new file mode 100644 index 00000000..84bb5694 --- /dev/null +++ b/Client/Assets/Scripts/XUtliPoolLib/SpriteTable.cs @@ -0,0 +1,182 @@ +using System; + +namespace XUtliPoolLib +{ + public class SpriteTable : CVSReader + { + public SpriteTable.RowData[] Table = null; + + public class RowData + { + public uint SpriteID; + + public string SpriteName; + + public uint SpriteQuality; + + public string SpriteIcon; + + public uint SpriteModelID; + + public uint SpriteSkillID; + + public uint AttrID1; + + public uint AttrID2; + + public uint AttrID3; + + public uint AttrID4; + + public uint AttrID5; + + public uint BaseAttr1; + + public uint BaseAttr2; + + public uint BaseAttr3; + + public uint BaseAttr4; + + public uint BaseAttr5; + + public SeqRef Range1; + + public SeqRef Range2; + + public SeqRef Range3; + + public SeqRef Range4; + + public SeqRef Range5; + + public uint PresentID; + + public string Color; + + public string DeathAnim; + + public string ReviveAnim; + + public int IllustrationShow; + } + + public SpriteTable.RowData GetBySpriteID(uint key) + { + bool flag = this.Table == null || this.Table.Length == 0; + SpriteTable.RowData result; + if (flag) + { + result = null; + } + else + { + for (int i = 0; i < this.Table.Length; i++) + { + bool flag2 = this.Table[i].SpriteID == key; + if (flag2) + { + return this.Table[i]; + } + } + result = null; + } + return result; + } + + public SpriteTable.RowData GetByPresentID(uint key) + { + bool flag = this.Table == null || this.Table.Length == 0; + SpriteTable.RowData result; + if (flag) + { + result = null; + } + else + { + for (int i = 0; i < this.Table.Length; i++) + { + bool flag2 = this.Table[i].PresentID == key; + if (flag2) + { + return this.Table[i]; + } + } + result = null; + } + return result; + } + + protected override void ReadLine(XBinaryReader reader) + { + SpriteTable.RowData rowData = new SpriteTable.RowData(); + base.Read(reader, ref rowData.SpriteID, CVSReader.uintParse); + this.columnno = 0; + base.Read(reader, ref rowData.SpriteName, CVSReader.stringParse); + this.columnno = 1; + base.Read(reader, ref rowData.SpriteQuality, CVSReader.uintParse); + this.columnno = 2; + base.Read(reader, ref rowData.SpriteIcon, CVSReader.stringParse); + this.columnno = 3; + base.Read(reader, ref rowData.SpriteModelID, CVSReader.uintParse); + this.columnno = 4; + base.Read(reader, ref rowData.SpriteSkillID, CVSReader.uintParse); + this.columnno = 7; + base.Read(reader, ref rowData.AttrID1, CVSReader.uintParse); + this.columnno = 10; + base.Read(reader, ref rowData.AttrID2, CVSReader.uintParse); + this.columnno = 11; + base.Read(reader, ref rowData.AttrID3, CVSReader.uintParse); + this.columnno = 12; + base.Read(reader, ref rowData.AttrID4, CVSReader.uintParse); + this.columnno = 13; + base.Read(reader, ref rowData.AttrID5, CVSReader.uintParse); + this.columnno = 14; + base.Read(reader, ref rowData.BaseAttr1, CVSReader.uintParse); + this.columnno = 15; + base.Read(reader, ref rowData.BaseAttr2, CVSReader.uintParse); + this.columnno = 16; + base.Read(reader, ref rowData.BaseAttr3, CVSReader.uintParse); + this.columnno = 17; + base.Read(reader, ref rowData.BaseAttr4, CVSReader.uintParse); + this.columnno = 18; + base.Read(reader, ref rowData.BaseAttr5, CVSReader.uintParse); + this.columnno = 19; + rowData.Range1.Read(reader, this.m_DataHandler); + this.columnno = 25; + rowData.Range2.Read(reader, this.m_DataHandler); + this.columnno = 26; + rowData.Range3.Read(reader, this.m_DataHandler); + this.columnno = 27; + rowData.Range4.Read(reader, this.m_DataHandler); + this.columnno = 28; + rowData.Range5.Read(reader, this.m_DataHandler); + this.columnno = 29; + base.Read(reader, ref rowData.PresentID, CVSReader.uintParse); + this.columnno = 47; + base.Read(reader, ref rowData.Color, CVSReader.stringParse); + this.columnno = 48; + base.Read(reader, ref rowData.DeathAnim, CVSReader.stringParse); + this.columnno = 49; + base.Read(reader, ref rowData.ReviveAnim, CVSReader.stringParse); + this.columnno = 50; + base.Read(reader, ref rowData.IllustrationShow, CVSReader.intParse); + this.columnno = 51; + this.Table[this.lineno] = rowData; + this.columnno = -1; + } + + protected override void OnClear(int lineCount) + { + bool flag = lineCount > 0; + if (flag) + { + this.Table = new SpriteTable.RowData[lineCount]; + } + else + { + this.Table = null; + } + } + } +} -- cgit v1.1-26-g67d0