| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  | using System; | 
					
						
							|  |  |  |  | using System.Data; | 
					
						
							|  |  |  |  | using UnityEngine; | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  | public class TableLevel : TableBase<TableLevel, DataLevel, int> | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  | { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |     public override DataLevel GetData(int pID) | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |     { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |         return mDataList.Find(pItem => pItem.LevelID == pID); | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |     } | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | [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; | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | } |