示例#1
0
        /// <summary>
        /// Gets the implant name for the given slot and the provided set.
        /// </summary>
        /// <param name="set"></param>
        /// <param name="slot"></param>
        /// <returns></returns>
        private static Implant GetImplant(SerializableSettingsImplantSet set, ImplantSlots slot)
        {
            // Invoke the property getter with the matching name through reflection
            object implantName = typeof(SerializableSettingsImplantSet).GetProperty(slot.ToString()).GetValue(set, null);

            return(StaticItems.GetImplants(slot)[(string)implantName]);
        }
示例#2
0
        /// <summary>
        /// Sets the implant name for the given slot and the provided set.
        /// </summary>
        /// <param name="set"></param>
        /// <param name="slot"></param>
        /// <param name="implant"></param>
        /// <returns></returns>
        private static void SetImplant(SerializableSettingsImplantSet set, ImplantSlots slot, Implant implant)
        {
            // Set may be null when the user is editing the phantom line
            if (set == null)
            {
                return;
            }

            // Invoke the property setter with the matching name through reflection
            typeof(SerializableSettingsImplantSet).GetProperty(slot.ToString()).SetValue(set, implant.Name, null);
        }
示例#3
0
        /// <summary>
        /// Sets the implant name for the given slot and the provided set.
        /// </summary>
        /// <param name="set"></param>
        /// <param name="slot"></param>
        /// <param name="implantName"></param>
        /// <returns></returns>
        private void SetImplant(SerializableSettingsImplantSet set, ImplantSlots slot, Implant implant)
        {
            // Set may be null when the user is editing the phantom line
            if (set == null) return;

            // Invoke the property setter with the matching name through reflection
            typeof(SerializableSettingsImplantSet).GetProperty(slot.ToString()).SetValue(set, implant.Name, null);
        }
示例#4
0
        /// <summary>
        /// Gets the implant name for the given slot and the provided set.
        /// </summary>
        /// <param name="set"></param>
        /// <param name="slot"></param>
        /// <returns></returns>
        private Implant GetImplant(SerializableSettingsImplantSet set, ImplantSlots slot)
        {
            // Invoke the property getter with the matching name through reflection
            var implantName = typeof(SerializableSettingsImplantSet).GetProperty(slot.ToString()).GetValue(set, null);

            return StaticItems.GetImplants(slot)[(string)implantName] as Implant;
        }