Example #1
0
        /// <summary>
        /// 値をセットする。
        /// </summary>
        /// <param name="paramName">パラメータ名</param>
        /// <param name="value">値</param>
        public void SetValue(string paramName, object value)
        {
            switch (paramName)
            {
            case "id":
                Id = (int)((double)(value));
                break;

            case "animationId":
                AnimationId = (int)((double)(value));
                break;

            case "description":
                Description = (string)(value);
                break;

            case "etypeId":
                EquipTypeId = (int)((double)(value));
                break;

            case "traits":
                Traits.Clear();
                Traits.AddRange((List <Trait>)(value));
                break;

            case "iconIndex":
                IconIndex = (int)((double)(value));
                break;

            case "name":
                Name = (string)(value);
                break;

            case "note":
                Note = (string)(value);
                break;

            case "params":
            {
                List <int> array = (List <int>)(value);
                for (int i = 0; (i < Params.Length) && (i < array.Count); i++)
                {
                    Params[i] = array[i];
                }
            }
            break;

            case "price":
                Price = (int)((double)(value));
                break;

            case "wtypeId":
                WeaponTypeId = (int)((double)(value));
                break;
            }
        }
Example #2
0
        /// <summary>
        /// このオブジェクトのフィールドを設定する。
        /// </summary>
        /// <param name="key">キー文字列</param>
        /// <param name="value">値</param>
        internal void SetValue(string key, object value)
        {
            switch (key)
            {
            case "id":
                Id = (int)((double)(value));
                break;

            case "battlerName":
                BattlerName = (string)(value);
                break;

            case "characterIndex":
                CharacterIndex = (int)((double)(value));
                break;

            case "characterName":
                CharacterName = (string)(value);
                break;

            case "classId":
                ClassId = (int)((double)(value));
                break;

            case "equips":
                Equips.Clear();
                Equips.AddRange((List <int>)(value));
                break;

            case "faceIndex":
                FaceIndex = (int)((double)(value));
                break;

            case "faceName":
                FaceName = (string)(value);
                break;

            case "traits":
                Traits.Clear();
                Traits.AddRange((List <Trait>)(value));
                break;

            case "initialLevel":
                InitialLevel = (int)((double)(value));
                break;

            case "maxLevel":
                MaxLevel = (int)((double)(value));
                break;

            case "name":
                Name = (string)(value);
                break;

            case "nickname":
                Nickname = (string)(value);
                break;

            case "note":
                Note = (string)(value);
                break;

            case "profile":
                Profile = (string)(value);
                break;

            default:
                throw new Exception($"Unknown key={key}");
            }
        }
Example #3
0
        /// <summary>
        /// 値を設定する。
        /// </summary>
        /// <param name="paramName"></param>
        /// <param name="value"></param>
        public void SetValue(string paramName, object value)
        {
            switch (paramName)
            {
            case "id":
                Id = (int)((double)(value));
                break;

            case "actions":
                Actions.Clear();
                Actions.AddRange((List <EnemyAction>)(value));
                break;

            case "battlerHue":
                BattlerHue = (int)((double)(value));
                break;

            case "battlerName":
                BattlerName = (string)(value);
                break;

            case "dropItems":
            {
                List <DropItem> dropItems = (List <DropItem>)(value);
                for (int i = 0; i < 3; i++)
                {
                    DropItem di = (i < dropItems.Count) ? dropItems[i] : null;
                    if (di != null)
                    {
                        DropItems[i].DataId      = di.DataId;
                        DropItems[i].Denominator = di.Denominator;
                        DropItems[i].Kind        = di.Kind;
                    }
                    else
                    {
                        DropItems[i] = new DropItem();
                    }
                }
            }
            break;

            case "exp":
                Exp = (int)((double)(value));
                break;

            case "traits":
                Traits.Clear();
                Traits.AddRange((List <Trait>)(value));
                break;

            case "gold":
                Gold = (int)((double)(value));
                break;

            case "name":
                Name = (string)(value);
                break;

            case "note":
                Note = (string)(value);
                break;

            case "params":
            {
                List <int> paramList = (List <int>)(value);
                for (int i = 0; i < 8; i++)
                {
                    if (i < paramList.Count)
                    {
                        Params[i] = paramList[i];
                    }
                    else
                    {
                        Params[i] = 0;
                    }
                }
            }
            break;
            }
        }