コード例 #1
0
        private void _autoAdd(DbAttribute attribute, ParameterHolderKeys key, ReadableTuple <int> tupleSource, ParameterHolder holder, int min = 0)
        {
            var sVal = tupleSource.GetValue <string>(attribute);
            int val  = 0;

            if (!string.IsNullOrEmpty(sVal))
            {
                Int32.TryParse(sVal, out val);
            }

            if (val > min)
            {
                holder.Values[key] = val.ToString(CultureInfo.InvariantCulture);
            }
        }
コード例 #2
0
        private void _autoAddCompound(DbAttribute attribute, ParameterHolderKeys para, ReadableTuple <int> tupleSource, ParameterHolder holder)
        {
            var sVal = tupleSource.GetValue <string>(attribute);
            int val;

            Int32.TryParse(sVal, out val);

            if (_is(val, 2))
            {
                holder.Values[para] = "Weapon";
            }
            else if (_is(val, 32))
            {
                holder.Values[para] = "Shield";
            }
            else if (_is(val, 8, 128))
            {
                if (val == 8)
                {
                    holder.Values[para] = "Accessory (Right)";
                }
                else if (val == 128)
                {
                    holder.Values[para] = "Accessory (Left)";
                }
                else
                {
                    holder.Values[para] = "Accessory";
                }
            }
            else if (_is(val, 16))
            {
                holder.Values[para] = "Armor";
            }
            else if (_is(val, 64))
            {
                holder.Values[para] = "Footgear";
            }
            else if (_is(val, 4))
            {
                holder.Values[para] = "Garment";
            }
            else if (_is(val, 1, 256, 512))
            {
                holder.Values[para] = "Headgear";
            }
        }
コード例 #3
0
        private void _autoAddEquippedOn(DbAttribute attribute, ParameterHolderKeys key, ReadableTuple <int> tupleSource, ParameterHolder holder)
        {
            var location = tupleSource.GetValue <int>(attribute);

            if (_is(location, 1, 256, 512))
            {
                List <string> values = new List <string>();

                if (_is(location, 256))
                {
                    values.Add("Upper");
                }
                if (_is(location, 512))
                {
                    values.Add("Mid");
                }
                if (_is(location, 1))
                {
                    values.Add("Lower");
                }

                holder.Values[key] = string.Join(", ", values.ToArray());
            }

            if (_is(location, 1024, 2048, 4096))
            {
                List <string> values = new List <string>();

                if (_is(location, 1024))
                {
                    values.Add("Upper");
                }
                if (_is(location, 2048))
                {
                    values.Add("Mid");
                }
                if (_is(location, 4096))
                {
                    values.Add("Lower");
                }

                holder.Values[key] = string.Join(", ", values.ToArray());
            }
        }