protected override object this[string index] { get { #region switch (index) { case "UserID": return UserID; case "PlotID": return PlotID; case "PlotStatus": return PlotStatus; case "ScoreNum": return ScoreNum; case "AttackScore": return AttackScore; case "DefenseScore": return DefenseScore; case "StarScore": return StarScore; case "ExpNum": return ExpNum; case "Experience": return Experience; case "PennyNum": return PennyNum; case "GoldNum": return GoldNum; case "ItemID": return ItemID; case "CompleteDate": return CompleteDate; case "RefleshDate": return RefleshDate; case "CreateDate": return CreateDate; case "BlessPennyNum": return BlessPennyNum; case "BlessExperience": return BlessExperience; case "EnchantID": return EnchantID; case "PlotSuccessType": return EnchantID; case "PlotFailureType": return EnchantID; case "HonourNum": return HonourNum; case "ItemList": return ItemList; case "PlotNum": return PlotNum; default: throw new ArgumentException(string.Format("UserPlot index[{0}] isn't exist.", index)); } #endregion } set { #region switch (index) { case "UserID": _UserID = value.ToNotNullString(); break; case "PlotID": _PlotID = value.ToInt(); break; case "PlotStatus": _PlotStatus = value.ToEnum<PlotStatus>(); break; case "ScoreNum": _ScoreNum = value.ToShort(); break; case "AttackScore": _AttackScore = value.ToShort(); break; case "DefenseScore": _DefenseScore = value.ToShort(); break; case "StarScore": _StarScore = value.ToShort(); break; case "ExpNum": _ExpNum = value.ToInt(); break; case "Experience": _Experience = value.ToInt(); break; case "PennyNum": _PennyNum = value.ToInt(); break; case "GoldNum": _GoldNum = value.ToInt(); break; case "ItemID": _ItemID = value.ToInt(); break; case "CompleteDate": _CompleteDate = value.ToDateTime(); break; case "RefleshDate": _RefleshDate = value.ToDateTime(); break; case "CreateDate": _CreateDate = value.ToDateTime(); break; case "BlessPennyNum": _BlessPennyNum = value.ToInt(); break; case "BlessExperience": _BlessExperience = value.ToInt(); break; case "EnchantID": _EnchantID = value.ToInt(); break; case "PlotSuccessType": _PlotSuccessType = value.ToEnum<PlotSuccessType>(); break; case "PlotFailureType": _PlotFailureType = value.ToEnum<PlotFailureType>(); break; case "HonourNum": _HonourNum = value.ToInt(); break; case "ItemList": _ItemList = ConvertCustomField<CacheList<UniversalInfo>>(value, index); break; case "PlotNum": _PlotNum = value.ToInt(); break; default: throw new ArgumentException(string.Format("UserPlot index[{0}] isn't exist.", index)); } #endregion } }
/// <summary> /// 获得失败类型 /// </summary> /// <param name="generalNum"></param> /// <param name="star"></param> /// <param name="plotSuccessType"></param> public static void GetFailure(int generalNum, out PlotFailureType plotFailureType) { plotFailureType = PlotFailureType.XiaoBai; switch (generalNum) { case 5: plotFailureType = PlotFailureType.WangBai; break; case 4: plotFailureType = PlotFailureType.KuiBai; break; case 3: plotFailureType = PlotFailureType.ChangBai; break; case 2: plotFailureType = PlotFailureType.DaBai; break; case 1: plotFailureType = PlotFailureType.XiaoBai; break; } }
protected override object this[string index] { get { #region switch (index) { case "UserID": return(UserID); case "PlotID": return(PlotID); case "PlotStatus": return(PlotStatus); case "ScoreNum": return(ScoreNum); case "AttackScore": return(AttackScore); case "DefenseScore": return(DefenseScore); case "StarScore": return(StarScore); case "ExpNum": return(ExpNum); case "Experience": return(Experience); case "PennyNum": return(PennyNum); case "GoldNum": return(GoldNum); case "ItemID": return(ItemID); case "CompleteDate": return(CompleteDate); case "RefleshDate": return(RefleshDate); case "CreateDate": return(CreateDate); case "BlessPennyNum": return(BlessPennyNum); case "BlessExperience": return(BlessExperience); case "EnchantID": return(EnchantID); case "PlotSuccessType": return(EnchantID); case "PlotFailureType": return(EnchantID); case "HonourNum": return(HonourNum); case "ItemList": return(ItemList); case "PlotNum": return(PlotNum); default: throw new ArgumentException(string.Format("UserPlot index[{0}] isn't exist.", index)); } #endregion } set { #region switch (index) { case "UserID": _UserID = value.ToNotNullString(); break; case "PlotID": _PlotID = value.ToInt(); break; case "PlotStatus": _PlotStatus = value.ToEnum <PlotStatus>(); break; case "ScoreNum": _ScoreNum = value.ToShort(); break; case "AttackScore": _AttackScore = value.ToShort(); break; case "DefenseScore": _DefenseScore = value.ToShort(); break; case "StarScore": _StarScore = value.ToShort(); break; case "ExpNum": _ExpNum = value.ToInt(); break; case "Experience": _Experience = value.ToInt(); break; case "PennyNum": _PennyNum = value.ToInt(); break; case "GoldNum": _GoldNum = value.ToInt(); break; case "ItemID": _ItemID = value.ToInt(); break; case "CompleteDate": _CompleteDate = value.ToDateTime(); break; case "RefleshDate": _RefleshDate = value.ToDateTime(); break; case "CreateDate": _CreateDate = value.ToDateTime(); break; case "BlessPennyNum": _BlessPennyNum = value.ToInt(); break; case "BlessExperience": _BlessExperience = value.ToInt(); break; case "EnchantID": _EnchantID = value.ToInt(); break; case "PlotSuccessType": _PlotSuccessType = value.ToEnum <PlotSuccessType>(); break; case "PlotFailureType": _PlotFailureType = value.ToEnum <PlotFailureType>(); break; case "HonourNum": _HonourNum = value.ToInt(); break; case "ItemList": _ItemList = ConvertCustomField <CacheList <UniversalInfo> >(value, index); break; case "PlotNum": _PlotNum = value.ToInt(); break; default: throw new ArgumentException(string.Format("UserPlot index[{0}] isn't exist.", index)); } #endregion } }