コード例 #1
0
        /// <summary>
        /// Gets the multiplier of an implant.
        /// </summary>
        /// <param name="implantType"></param>
        /// <returns></returns>
        private double GetImplantMultiplier(string implantType)
        {
            ImplantSet implantSet     = (ImplantSet)cbImplantSet.Tag;
            string     implantSubname = String.Format("Zainou 'Beancounter' {0}", implantType);

            Implant implant = implantSet.FirstOrDefault(x => x.Name.Contains(implantSubname));

            if (implant == null)
            {
                return(1.0d);
            }

            double bonus      = implant.Properties.FirstOrDefault(x => Array.IndexOf(DBConstants.IndustryModifyingPropertyIDs, x.Property.ID) != -1).IValue;
            double multiplier = 1.0d + (bonus / 100);

            return(multiplier);
        }
コード例 #2
0
        /// <summary>
        /// Gets the multiplier of an implant.
        /// </summary>
        /// <returns></returns>
        private double GetImplantMultiplier(ICollection <int> implantIDs)
        {
            ImplantSet implantSet = (ImplantSet)cbImplantSet.Tag;

            Implant implant = implantSet?.FirstOrDefault(x => implantIDs.Contains(x.ID));

            if (implant == null)
            {
                return(1.0d);
            }

            double bonus = implant.Properties
                           .FirstOrDefault(x => DBConstants.IndustryModifyingPropertyIDs.IndexOf(x.Property.ID) != -1)
                           .Int64Value;
            double multiplier = 1.0d + bonus / 100;

            return(multiplier);
        }