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/PlantSeed.cs | 119 ++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 Client/Assets/Scripts/XUtliPoolLib/PlantSeed.cs (limited to 'Client/Assets/Scripts/XUtliPoolLib/PlantSeed.cs') diff --git a/Client/Assets/Scripts/XUtliPoolLib/PlantSeed.cs b/Client/Assets/Scripts/XUtliPoolLib/PlantSeed.cs new file mode 100644 index 00000000..eadbad89 --- /dev/null +++ b/Client/Assets/Scripts/XUtliPoolLib/PlantSeed.cs @@ -0,0 +1,119 @@ +using System; + +namespace XUtliPoolLib +{ + public class PlantSeed : CVSReader + { + public PlantSeed.RowData[] Table = null; + + public class RowData + { + public uint SeedID; + + public string SeedName; + + public SeqRef PlantID; + + public string PlantName; + + public uint GrowUpAmount; + + public uint GrowUpAmountPerMinute; + + public uint PredictGrowUpTime; + + public SeqRef HarvestPlant; + + public SeqRef ExtraDropItem; + + public uint IncreaseGrowUpRate; + + public uint ReduceGrowUpRate; + + public uint PlantStateCD; + + public uint BadStateGrowUpRate; + + public SeqRef StealAward; + + public uint CanStealMaxTimes; + + public uint InitUpAmount; + } + + public PlantSeed.RowData GetBySeedID(uint key) + { + bool flag = this.Table == null || this.Table.Length == 0; + PlantSeed.RowData result; + if (flag) + { + result = null; + } + else + { + for (int i = 0; i < this.Table.Length; i++) + { + bool flag2 = this.Table[i].SeedID == key; + if (flag2) + { + return this.Table[i]; + } + } + result = null; + } + return result; + } + + protected override void ReadLine(XBinaryReader reader) + { + PlantSeed.RowData rowData = new PlantSeed.RowData(); + base.Read(reader, ref rowData.SeedID, CVSReader.uintParse); + this.columnno = 0; + base.Read(reader, ref rowData.SeedName, CVSReader.stringParse); + this.columnno = 1; + rowData.PlantID.Read(reader, this.m_DataHandler); + this.columnno = 2; + base.Read(reader, ref rowData.PlantName, CVSReader.stringParse); + this.columnno = 3; + base.Read(reader, ref rowData.GrowUpAmount, CVSReader.uintParse); + this.columnno = 8; + base.Read(reader, ref rowData.GrowUpAmountPerMinute, CVSReader.uintParse); + this.columnno = 9; + base.Read(reader, ref rowData.PredictGrowUpTime, CVSReader.uintParse); + this.columnno = 10; + rowData.HarvestPlant.Read(reader, this.m_DataHandler); + this.columnno = 12; + rowData.ExtraDropItem.Read(reader, this.m_DataHandler); + this.columnno = 15; + base.Read(reader, ref rowData.IncreaseGrowUpRate, CVSReader.uintParse); + this.columnno = 17; + base.Read(reader, ref rowData.ReduceGrowUpRate, CVSReader.uintParse); + this.columnno = 18; + base.Read(reader, ref rowData.PlantStateCD, CVSReader.uintParse); + this.columnno = 19; + base.Read(reader, ref rowData.BadStateGrowUpRate, CVSReader.uintParse); + this.columnno = 21; + rowData.StealAward.Read(reader, this.m_DataHandler); + this.columnno = 22; + base.Read(reader, ref rowData.CanStealMaxTimes, CVSReader.uintParse); + this.columnno = 27; + base.Read(reader, ref rowData.InitUpAmount, CVSReader.uintParse); + this.columnno = 28; + this.Table[this.lineno] = rowData; + this.columnno = -1; + } + + protected override void OnClear(int lineCount) + { + bool flag = lineCount > 0; + if (flag) + { + this.Table = new PlantSeed.RowData[lineCount]; + } + else + { + this.Table = null; + } + } + } +} -- cgit v1.1-26-g67d0