当前位置: 首页>>代码示例>>C#>>正文


C# XmlDbRow.GetFloat方法代码示例

本文整理汇总了C#中XmlDbRow.GetFloat方法的典型用法代码示例。如果您正苦于以下问题:C# XmlDbRow.GetFloat方法的具体用法?C# XmlDbRow.GetFloat怎么用?C# XmlDbRow.GetFloat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XmlDbRow的用法示例。


在下文中一共展示了XmlDbRow.GetFloat方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Parse

        public override void Parse(XmlDbRow row)
        {
            base.Parse(row);

            mMinIntensityDuration = row.GetFloat("MinIntensityDuration", 0);
            mTransitionTime.First = row.GetFloat("MinTransitionTime", 0);
            mTransitionTime.Second = row.GetFloat("MaxTransitionTime", 0);
            mIntensityWeights = new List<int>();
            mIntensityWeights.Add(row.GetInt("LightWeight", 0));
            mIntensityWeights.Add(row.GetInt("ModerateWeight", 0));
            mIntensityWeights.Add(row.GetInt("HeavyWeight", 0));
            mIntensityChangeWeights = new List<int>();

            foreach (string strValue in row.GetStringList("NumIntensityChangeWeights", ','))
            {
                float value;
                if (float.TryParse(strValue, out value))
                {
                    mIntensityChangeWeights.Add((int)value);
                }
                else
                {
                    mIntensityChangeWeights.Add(0);
                }
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:26,代码来源:PercipitationData.cs

示例2: Parse

 public virtual void Parse(XmlDbRow row)
 {
     mWeight = row.GetInt("Weight", 0);
     mLength.First = row.GetFloat("MinLength", 0);
     mLength.Second = row.GetFloat("MaxLength", 0);
     mTemp.First = row.GetFloat("MinTemp", 0);
     mTemp.Second = row.GetFloat("MaxTemp", 0);
 }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:8,代码来源:WeatherData.cs

示例3: FitnessSymptom

        public FitnessSymptom(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "Minimum", Guid))
            {
                mMinimum = row.GetFloat("Minimum");
            }

            if (BooterLogger.Exists(row, "Maximum", Guid))
            {
                mMaximum = row.GetFloat("Maximum");
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:13,代码来源:FitnessSymptom.cs

示例4: ParseTemperature

        public void ParseTemperature(XmlDbRow row)
        {
            mStart = row.GetInt("StartDay", 1);
            mEnd = row.GetInt("EndDay", -1);

            if (row.Exists("Enabled"))
            {
                mEnabled = row.GetBool("Enabled");
            }

            for (int i = 0x0; i < SeasonsManager.TemperatureManager.kTimeNames.Length; i++)
            {
                string column = SeasonsManager.TemperatureManager.kTimeNames[i] + "Min";
                float min = row.GetFloat(column, -1f);

                column = SeasonsManager.TemperatureManager.kTimeNames[i] + "Max";
                float max = row.GetFloat(column, -1f);

                switch (i)
                {
                    case 0:
                        mMorningTemp = new Pair<float, float>(min, max);
                        break;
                    case 1:
                        mNoonTemp = new Pair<float, float>(min, max);
                        break;
                    case 2:
                        mEveningTemp = new Pair<float, float>(min, max);
                        break;
                    case 3:
                        mNightTemp = new Pair<float, float>(min, max);
                        break;
                }
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:35,代码来源:WeatherProfile.cs

示例5: Perform

        // From AcademicDegreeManager:CreateAcademicDegreeTable
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            AcademicDegreeNames academicDegree = AcademicDegreeNames.Undefined;

            if (!row.TryGetEnum<AcademicDegreeNames>("AcademicDegreeEnum", out academicDegree, AcademicDegreeNames.Undefined))
            {
                academicDegree = unchecked((AcademicDegreeNames)ResourceUtils.HashString64(row.GetString("AcademicDegreeEnum")));
            }

            BooterLogger.AddTrace("AcademicDegreeEnum: " + row.GetString("AcademicDegreeEnum"));

            string degreeNameKey = row.GetString("AcademicDegreeName");
            string degreeDescKey = row.GetString("AcademicDegreeDesc");
            string degreeIcon = row.GetString("AcademicDegreeIcon");
            int degreeCreditHours = row.GetInt("AcademicDegreeRequiredCreditHours");
            float degreeCostPerCredit = row.GetFloat("AcademicDegreeCostPerCredit");
            string degreeResponsibilitiesKey = row.GetString("ResponsibilityTooltipKey");

            JobId academicDefaultCourseID;
            if (!row.TryGetEnum<JobId>("AcademicDefaultCourseID", out academicDefaultCourseID, JobId.AcademicsGenericRabbitHoleCourse))
            {
                // Custom
                academicDefaultCourseID = unchecked((JobId)ResourceUtils.HashString64(row.GetString("AcademicDefaultCourseID")));
            }

            JobId academicDefaultLectureID;
            if (!row.TryGetEnum<JobId>("AcademicDefaultLectureID", out academicDefaultLectureID, JobId.Invalid))
            {
                // Custom
                academicDefaultLectureID = unchecked((JobId)ResourceUtils.HashString64(row.GetString("AcademicDefaultLectureID")));                
            }

            JobId academicDefaultLabID;
            if (!row.TryGetEnum<JobId>("AcademicDefaultLabID", out academicDefaultLabID, JobId.Invalid))
            {
                // Custom
                academicDefaultLabID = unchecked((JobId)ResourceUtils.HashString64(row.GetString("AcademicDefaultLabID")));
            }

            List<OccupationNames> associatedOccupations = new List<OccupationNames>();
            List<string> list2 = row.GetStringList("AssociatedOccupationNameEnum", ',', true);
            for (int i = 0x0; i < list2.Count; i++)
            {
                OccupationNames occupation;
                if (!ParserFunctions.TryParseEnum<OccupationNames>(list2[i], out occupation, OccupationNames.Undefined))
                {
                    occupation = unchecked((OccupationNames)ResourceUtils.HashString64(row.GetString(list2[i])));
                }

                if (occupation != OccupationNames.Undefined)
                {
                    associatedOccupations.Add(occupation);
                }
            }

            OccupationNames grantedOccupation;
            if (!ParserFunctions.TryParseEnum<OccupationNames>("GrantedOccupationNameEnum", out grantedOccupation, OccupationNames.Undefined))
            {
                // Custom
                grantedOccupation = unchecked((OccupationNames)ResourceUtils.HashString64(row.GetString("GrantedOccupationNameEnum")));
            }

            List<TraitNames> beneficialTraits;
            List<TraitNames> detrimentalTraits;
            List<TraitNames> suggestedTraits;
            ParserFunctions.TryParseCommaSeparatedList<TraitNames>(row["BeneficialTraits"], out beneficialTraits, TraitNames.Unknown);
            ParserFunctions.TryParseCommaSeparatedList<TraitNames>(row["DetrimentalTraits"], out detrimentalTraits, TraitNames.Unknown);
            ParserFunctions.TryParseCommaSeparatedList<TraitNames>(row["SuggestedTraits"], out suggestedTraits, TraitNames.Unknown);

            AcademicDegreeStaticData staticData = null;
            if (!AcademicDegreeManager.sDictionary.TryGetValue((ulong)academicDegree, out staticData))
            {
                staticData = new AcademicDegreeStaticData(academicDegree, degreeNameKey, degreeDescKey, degreeResponsibilitiesKey, degreeIcon, degreeCreditHours, degreeCostPerCredit, academicDefaultCourseID, academicDefaultLectureID, academicDefaultLabID, associatedOccupations, grantedOccupation, beneficialTraits, detrimentalTraits, suggestedTraits);
            }
            else
            {
                staticData.BeneficialTraits.AddRange(beneficialTraits);
                staticData.DetrimentalTraits.AddRange(detrimentalTraits);
                staticData.SuggestedTraits.AddRange(suggestedTraits);
                staticData.AssociatedOccupations.AddRange(associatedOccupations);
            }

            string skillsThatGrantXP = row.GetString("SkillsThatGrantXP");
            if (!string.IsNullOrEmpty(skillsThatGrantXP))
            {
                foreach (string str6 in skillsThatGrantXP.Split(new char[] { ';' }))
                {
                    string[] strArray2 = str6.Split(new char[] { ',' });
                    if (strArray2.Length != 0x2) continue;

                    float num4 = ParserFunctions.ParseFloat(strArray2[0x1], -1234123f);
                    if (num4 == -1234123f) continue;

                    // Custom
                    SkillNames skillName = SkillManager.sSkillEnumValues.ParseEnumValue(strArray2[0x0]);
                    if (skillName == SkillNames.None) continue;

                    staticData.AddSkill(skillName, num4);
                }
//.........这里部分代码省略.........
开发者ID:Robobeurre,项目名称:NRaas,代码行数:101,代码来源:AcademicDegreeBooter.cs


注:本文中的XmlDbRow.GetFloat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。