コード例 #1
0
        private T2 GetT2AmmoTypes(Item weapon)
        {
            var attribute = weapon.GetAttributeByIdOrNull(CHARGE_GROUP_2_ID);
            if (attribute != null && _t2Ammo.ContainsKey((int) attribute.Value))
            {
                return _t2Ammo[(int) attribute.Value];
            }

            attribute = weapon.GetAttributeByIdOrNull(CHARGE_GROUP_3_ID);
            if (attribute != null && _t2Ammo.ContainsKey((int) attribute.Value))
            {
                return _t2Ammo[(int) attribute.Value];
            }

            attribute = weapon.GetAttributeByIdOrNull(CHARGE_GROUP_4_ID);
            if (attribute != null && _t2Ammo.ContainsKey((int) attribute.Value))
            {
                return _t2Ammo[(int) attribute.Value];
            }
            return null;
        }
コード例 #2
0
 private static ChargeSize GetChargeSize(Item weapon)
 {
     return (ChargeSize) (int) ((weapon.GetAttributeByIdOrNull(CHARGE_SIZE_ID_ATTRIBUTE_ID)
                                    ?.Value) ?? (int?) ChargeSize.NoSize);
 }