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


C# Cyberware.ConvertToCyberwareGrade方法代码示例

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


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

示例1: AddPACKSKit


//.........这里部分代码省略.........
                        objWeapon.UnderbarrelWeapons.Add(objUnderbarrelWeapon);
                        objNode.Nodes.Add(objUnderbarrelNode);
                        objNode.Expand();
                    }

                    objNode.ContextMenuStrip = cmsWeapon;
                    treWeapons.Nodes[0].Nodes.Add(objNode);
                    treWeapons.Nodes[0].Expand();

                    Application.DoEvents();
                }
            }

            // Update Cyberware.
            if (objXmlKit["cyberwares"] != null)
            {
                XmlDocument objXmlCyberwareDocument = XmlManager.Instance.Load("cyberware.xml");
                XmlDocument objXmlGearDocument = XmlManager.Instance.Load("gear.xml");

                pgbProgress.Visible = true;
                pgbProgress.Value = 0;
                pgbProgress.Maximum = objXmlKit.SelectNodes("cyberwares/cyberware").Count;
                int i = 0;
                foreach (XmlNode objXmlCyberware in objXmlKit.SelectNodes("cyberwares/cyberware"))
                {
                    i++;
                    pgbProgress.Value = i;
                    Application.DoEvents();

                    List<Weapon> objWeapons = new List<Weapon>();
                    List<TreeNode> objWeaponNodes = new List<TreeNode>();
                    TreeNode objNode = new TreeNode();
                    Cyberware objCyberware = new Cyberware(_objCharacter);
                    Grade objGrade = objCyberware.ConvertToCyberwareGrade(objXmlCyberware["grade"].InnerText, Improvement.ImprovementSource.Cyberware);

                    int intRating = 0;
                    if (objXmlCyberware["rating"] != null)
                        intRating = Convert.ToInt32(objXmlCyberware["rating"].InnerText);

                    XmlNode objXmlCyberwareNode = objXmlCyberwareDocument.SelectSingleNode("/chummer/cyberwares/cyberware[name = \"" + objXmlCyberware["name"].InnerText + "\"]");
                    objCyberware.Create(objXmlCyberwareNode, _objCharacter, objGrade, Improvement.ImprovementSource.Cyberware, intRating, objNode, objWeapons, objWeaponNodes, true, blnCreateChildren);
                    _objCharacter.Cyberware.Add(objCyberware);

                    // Add any children.
                    if (objXmlCyberware["cyberwares"] != null)
                    {
                        foreach (XmlNode objXmlChild in objXmlCyberware.SelectNodes("cyberwares/cyberware"))
                        {
                            TreeNode objChildNode = new TreeNode();
                            Cyberware objChildCyberware = new Cyberware(_objCharacter);

                            int intChildRating = 0;
                            if (objXmlChild["rating"] != null)
                                intChildRating = Convert.ToInt32(objXmlChild["rating"].InnerText);

                            XmlNode objXmlChildNode = objXmlCyberwareDocument.SelectSingleNode("/chummer/cyberwares/cyberware[name = \"" + objXmlChild["name"].InnerText + "\"]");
                            objChildCyberware.Create(objXmlChildNode, _objCharacter, objGrade, Improvement.ImprovementSource.Cyberware, intChildRating, objChildNode, objWeapons, objWeaponNodes, true, blnCreateChildren);
                            objCyberware.Children.Add(objChildCyberware);
                            objChildNode.ContextMenuStrip = cmsCyberware;

                            foreach (XmlNode objXmlGear in objXmlChild.SelectNodes("gears/gear"))
                                AddPACKSGear(objXmlGearDocument, objXmlGear, objChildNode, objChildCyberware, cmsCyberwareGear, blnCreateChildren);

                            objNode.Nodes.Add(objChildNode);
                            objNode.Expand();
                        }
开发者ID:cormanater,项目名称:chummer5a,代码行数:67,代码来源:frmCreate.cs

示例2: AddCyberwareSuite

        private void AddCyberwareSuite(Improvement.ImprovementSource objSource)
        {
            frmSelectCyberwareSuite frmPickCyberwareSuite = new frmSelectCyberwareSuite(objSource, _objCharacter);
            frmPickCyberwareSuite.ShowDialog(this);

            if (frmPickCyberwareSuite.DialogResult == DialogResult.Cancel)
                return;

            string strType = "";
            int intParentNode = 0;
            if (objSource == Improvement.ImprovementSource.Cyberware)
            {
                strType = "cyberware";
                intParentNode = 0;
            }
            else
            {
                strType = "bioware";
                intParentNode = 1;
            }
            XmlDocument objXmlDocument = XmlManager.Instance.Load(strType + ".xml");

            XmlNode objXmlSuite = objXmlDocument.SelectSingleNode("/chummer/suites/suite[name = \"" + frmPickCyberwareSuite.SelectedSuite + "\"]");
            Cyberware objTemp = new Cyberware(_objCharacter);
            Grade objGrade = new Grade();
            objGrade = objTemp.ConvertToCyberwareGrade(objXmlSuite["grade"].InnerText, objSource);

            // Run through each of the items in the Suite and add them to the character.
            foreach (XmlNode objXmlItem in objXmlSuite.SelectNodes(strType + "s/" + strType))
            {
                XmlNode objXmlCyberware = objXmlDocument.SelectSingleNode("/chummer/" + strType + "s/" + strType + "[name = \"" + objXmlItem["name"].InnerText + "\"]");
                TreeNode objNode = new TreeNode();
                int intRating = 0;

                if (objXmlItem["rating"] != null)
                    intRating = Convert.ToInt32(objXmlItem["rating"].InnerText);

                objNode = CreateSuiteCyberware(objXmlItem, objXmlCyberware, objGrade, intRating, true, objSource, strType, null);

                objNode.Expand();
                treCyberware.Nodes[intParentNode].Nodes.Add(objNode);
                treCyberware.Nodes[intParentNode].Expand();
            }

            _blnIsDirty = true;
            UpdateWindowTitle();
            UpdateCharacterInfo();
        }
开发者ID:cormanater,项目名称:chummer5a,代码行数:48,代码来源:frmCreate.cs

示例3: AddCyberwareSuite

        private void AddCyberwareSuite(Improvement.ImprovementSource objSource)
        {
            frmSelectCyberwareSuite frmPickCyberwareSuite = new frmSelectCyberwareSuite(objSource, _objCharacter);
            frmPickCyberwareSuite.ShowDialog(this);

            if (frmPickCyberwareSuite.DialogResult == DialogResult.Cancel)
                return;

            int intCost = frmPickCyberwareSuite.TotalCost;
            if (intCost > _objCharacter.Nuyen)
            {
                MessageBox.Show(LanguageManager.Instance.GetString("Message_NotEnoughNuyen"), LanguageManager.Instance.GetString("MessageTitle_NotEnoughNuyen"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            else
            {
                // Create the Expense Log Entry.
                ExpenseLogEntry objExpense = new ExpenseLogEntry();
                objExpense.Create(intCost * -1, LanguageManager.Instance.GetString("String_ExpensePurchaseCyberwareSuite") + " " + frmPickCyberwareSuite.SelectedSuite, ExpenseType.Nuyen, DateTime.Now);
                _objCharacter.ExpenseEntries.Add(objExpense);
                _objCharacter.Nuyen -= intCost;
            }

            string strType = "";
            int intParentNode = 0;
            if (objSource == Improvement.ImprovementSource.Cyberware)
            {
                strType = "cyberware";
                intParentNode = 0;
            }
            else
            {
                strType = "bioware";
                intParentNode = 1;
            }
            XmlDocument objXmlDocument = XmlManager.Instance.Load(strType + ".xml");

            XmlNode objXmlSuite = objXmlDocument.SelectSingleNode("/chummer/suites/suite[name = \"" + frmPickCyberwareSuite.SelectedSuite + "\"]");
            Cyberware objTemp = new Cyberware(_objCharacter);
            Grade objGrade = new Grade();
            objGrade = objTemp.ConvertToCyberwareGrade(objXmlSuite["grade"].InnerText, objSource);

            // Run through each of the items in the Suite and add them to the character.
            foreach (XmlNode objXmlItem in objXmlSuite.SelectNodes(strType + "s/" + strType))
            {
                XmlNode objXmlCyberware = objXmlDocument.SelectSingleNode("/chummer/" + strType + "s/" + strType + "[name = \"" + objXmlItem["name"].InnerText + "\"]");
                TreeNode objNode = new TreeNode();
                int intRating = 0;

                if (objXmlItem["rating"] != null)
                    intRating = Convert.ToInt32(objXmlItem["rating"].InnerText);

                objNode = CreateSuiteCyberware(objXmlItem, objXmlCyberware, objGrade, intRating, true, objSource, strType, null);

                objNode.Expand();
                treCyberware.Nodes[intParentNode].Nodes.Add(objNode);
                treCyberware.Nodes[intParentNode].Expand();
            }

            _blnIsDirty = true;
            UpdateWindowTitle();
            UpdateCharacterInfo();
        }
开发者ID:Althalusdlg,项目名称:chummer5a,代码行数:63,代码来源:frmCareer.cs


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