Exemplo n.º 1
0
        protected override object this[string index]
        {
            get
            {
                #region
                switch (index)
                {
                case "Id": return(_id);

                case "Name": return(_name);

                case "Type": return(_type);

                case "TargetNum": return(_targetNum);

                case "HeadIcon": return(_headIcon);

                case "Description": return(_description);

                default: throw new ArgumentException(string.Format("AchievementInfo index[{0}] isn't exist.", index));
                }
                #endregion
            }
            set
            {
                #region
                switch (index)
                {
                case "Id":
                    _id = value.ToInt();
                    break;

                case "Name":
                    _name = value.ToNotNullString();
                    break;

                case "Type":
                    _type = value.ToEnum <AchieveType>();
                    break;

                case "TargetNum":
                    _targetNum = value.ToInt();
                    break;

                case "HeadIcon":
                    _headIcon = value.ToNotNullString();
                    break;

                case "Description":
                    _description = value.ToNotNullString();
                    break;

                default: throw new ArgumentException(string.Format("AchievementInfo index[{0}] isn't exist.", index));
                }
                #endregion
            }
        }
Exemplo n.º 2
0
 public void Mark(string levelName, AchieveType type, int num = 1)
 {
     foreach (var v in AchieveConfiguration.achieveDictionary)
     {
         if (v.Value.level.CompareTo(levelName) == 0 && v.Value.type == type)
         {
             Add(v.Key, num);
             break;
         }
     }
 }
 public void Mark(string levelName, AchieveType type, int num = 1)
 {
     foreach(var v in AchieveConfiguration.achieveDictionary)
     {
         if(v.Value.level.CompareTo(levelName) == 0 && v.Value.type == type)
         {
             Add(v.Key, num);
             break;
         }
     }
 }
Exemplo n.º 4
0
 protected override object this[string index]
 {
     get
     {
         #region
         switch (index)
         {
             case "Id": return _id;
             case "Name": return _name;
             case "Type": return _type;
             case "TargetNum": return _targetNum;
             case "HeadIcon": return _headIcon;
             case "Description": return _description;
             default: throw new ArgumentException(string.Format("AchievementInfo index[{0}] isn't exist.", index));
         }
         #endregion
     }
     set
     {
         #region
         switch (index)
         {
             case "Id":
                 _id = value.ToInt();
                 break;
             case "Name":
                 _name = value.ToNotNullString();
                 break;
             case "Type":
                 _type = value.ToEnum<AchieveType>();
                 break;
             case "TargetNum":
                 _targetNum = value.ToInt();
                 break;
             case "HeadIcon":
                 _headIcon = value.ToNotNullString();
                 break;
             case "Description":
                 _description = value.ToNotNullString();
                 break;
             default: throw new ArgumentException(string.Format("AchievementInfo index[{0}] isn't exist.", index));
         }
         #endregion
     }
 }