49 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			49 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			C#
		
	
	
	
|  | using System; | |||
|  | using System.Data; | |||
|  | using UnityEngine; | |||
|  | 
 | |||
|  | public class TableLevel : TableBase<TableLevel, DataLevel> | |||
|  | { | |||
|  |     public override DataLevel GetData(string pID) | |||
|  |     { | |||
|  |         return mDataList.Find(pItem => pItem.LevelID.ToString().Equals(pID)); | |||
|  |     } | |||
|  | } | |||
|  | 
 | |||
|  | [Serializable] | |||
|  | public class DataLevel : DataBase<DataLevel> | |||
|  | { | |||
|  |     public int RetryTotal => Retry1Num + Retry2Num; | |||
|  | 
 | |||
|  |     public int LevelID; | |||
|  |     public int FirstNum; | |||
|  |     public int Retry1Num; | |||
|  |     public int Retry2Num; | |||
|  |     public int TotalNum; | |||
|  |     public int UnitNum; | |||
|  |     public int MaxLevel; | |||
|  |     public string Formation; | |||
|  |     public bool IsBoss; | |||
|  | 
 | |||
|  |     public override void ParseData(DataRow pCollection) | |||
|  |     { | |||
|  |         LevelID = 0; | |||
|  |         int.TryParse(pCollection[0].ToString(), out LevelID); | |||
|  |         FirstNum = 0; | |||
|  |         int.TryParse(pCollection[1].ToString(), out FirstNum); | |||
|  |         Retry1Num = 0; | |||
|  |         int.TryParse(pCollection[2].ToString(), out Retry1Num); | |||
|  |         Retry2Num = 0; | |||
|  |         int.TryParse(pCollection[3].ToString(), out Retry2Num); | |||
|  |         TotalNum = 0; | |||
|  |         int.TryParse(pCollection[4].ToString(), out TotalNum); | |||
|  |         UnitNum = 0; | |||
|  |         int.TryParse(pCollection[5].ToString(), out UnitNum); | |||
|  |         MaxLevel = 0; | |||
|  |         int.TryParse(pCollection[6].ToString(), out MaxLevel); | |||
|  |         Formation = string.IsNullOrEmpty(pCollection[8].ToString()) ? "" : pCollection[8].ToString(); | |||
|  |         int tIsBoss = 0; | |||
|  |         int.TryParse(pCollection[9].ToString(), out tIsBoss); | |||
|  |         IsBoss = tIsBoss == 1; | |||
|  |     } | |||
|  | } |