• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Improvement.ImprovementSource类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Improvement.ImprovementSource的典型用法代码示例。如果您正苦于以下问题:C# Improvement.ImprovementSource类的具体用法?C# Improvement.ImprovementSource怎么用?C# Improvement.ImprovementSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Improvement.ImprovementSource类属于命名空间,在下文中一共展示了Improvement.ImprovementSource类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: frmCreateCyberwareSuite

        public frmCreateCyberwareSuite(Character objCharacter, Improvement.ImprovementSource objSource)
        {
            InitializeComponent();
            _objSource = objSource;
            LanguageManager.Instance.Load(GlobalOptions.Instance.Language, this);
            _objCharacter = objCharacter;

            if (_objSource == Improvement.ImprovementSource.Cyberware)
                _strType = "cyberware";
            else
            {
                _strType = "bioware";
                this.Text = LanguageManager.Instance.GetString("Title_CreateBiowareSuite");
            }

            txtFileName.Text = "custom_" + _strType + ".xml";
        }
开发者ID:blackmage5242,项目名称:chummer5a-master,代码行数:17,代码来源:frmCreateCyberwareSuite.cs


示例2: frmSelectCyberwareSuite

        public frmSelectCyberwareSuite(Improvement.ImprovementSource objSource, Character objCharacter)
        {
            InitializeComponent();
            _objSource = objSource;
            LanguageManager.Instance.Load(GlobalOptions.Instance.Language, this);

            if (_objSource == Improvement.ImprovementSource.Cyberware)
                _strType = "cyberware";
            else
            {
                _strType = "bioware";
                this.Text = LanguageManager.Instance.GetString("Title_SelectBiowareSuite");
                lblCyberwareLabel.Text = LanguageManager.Instance.GetString("Label_SelectBiowareSuite_PartsInSuite");
            }

            _objCharacter = objCharacter;
        }
开发者ID:kingcortez905,项目名称:chummer5,代码行数:17,代码来源:frmSelectCyberwareSuite.cs


示例3: Load

        /// <summary>
        /// Load the Enhancement from the XmlNode.
        /// </summary>
        /// <param name="objNode">XmlNode to load.</param>
        public void Load(XmlNode objNode)
        {
            Improvement objImprovement = new Improvement();
            _guiID = Guid.Parse(objNode["guid"].InnerText);
            _strName = objNode["name"].InnerText;
            _strSource = objNode["source"].InnerText;
            _strPage = objNode["page"].InnerText;
            _nodBonus = objNode["bonus"];
            _objImprovementSource = objImprovement.ConvertToImprovementSource(objNode["improvementsource"].InnerText);

            try
            {
                _intGrade = Convert.ToInt32(objNode["grade"].InnerText);
            }
            catch
            {
            }
            try
            {
                _strNotes = objNode["notes"].InnerText;
            }
            catch
            {
            }
        }
开发者ID:Vanatrix,项目名称:chummer5a,代码行数:29,代码来源:clsUnique.cs


示例4: Create

        /// Create an Enhancement from an XmlNode and return the TreeNodes for it.
        /// <param name="objXmlEnhancementNode">XmlNode to create the object from.</param>
        /// <param name="objCharacter">Character the Enhancement is being added to.</param>
        /// <param name="objNode">TreeNode to populate a TreeView.</param>
        /// <param name="objSource">Source of the Improvement.</param>
        public void Create(XmlNode objXmlArtNode, Character objCharacter, TreeNode objNode, Improvement.ImprovementSource objSource)
        {
            _strName = objXmlArtNode["name"].InnerText;
            _strSource = objXmlArtNode["source"].InnerText;
            _strPage = objXmlArtNode["page"].InnerText;
            _objImprovementSource = objSource;
            try
            {
                _intGrade = Convert.ToInt32(objXmlArtNode["grade"].InnerText);
            }
            catch { }
            if (objXmlArtNode.InnerXml.Contains("<bonus>"))
            {
                _nodBonus = objXmlArtNode["bonus"];

                ImprovementManager objImprovementManager = new ImprovementManager(objCharacter);
                if (!objImprovementManager.CreateImprovements(objSource, _guiID.ToString(), _nodBonus, true, 1, DisplayNameShort))
                {
                    _guiID = Guid.Empty;
                    return;
                }
                if (objImprovementManager.SelectedValue != "")
                    _strName += " (" + objImprovementManager.SelectedValue + ")";
            }

            objNode.Text = LanguageManager.Instance.GetString("Label_Enhancement") + " " + DisplayName;
            objNode.Tag = _guiID.ToString();
        }
开发者ID:Vanatrix,项目名称:chummer5a,代码行数:33,代码来源:clsUnique.cs


示例5: Load

        /// <summary>
        /// Load the Metamagic from the XmlNode.
        /// </summary>
        /// <param name="objNode">XmlNode to load.</param>
        public void Load(XmlNode objNode)
        {
            Improvement objImprovement = new Improvement();
            _guiID = Guid.Parse(objNode["guid"].InnerText);
            _strName = objNode["name"].InnerText;
            _strSource = objNode["source"].InnerText;
            _strPage = objNode["page"].InnerText;
            try
            {
                _blnPaidWithKarma = Convert.ToBoolean(objNode["paidwithkarma"].InnerText);
            }
            catch
            {
            }

            _nodBonus = objNode["bonus"];
            _objImprovementSource = objImprovement.ConvertToImprovementSource(objNode["improvementsource"].InnerText);

            try
            {
                _strNotes = objNode["notes"].InnerText;
            }
            catch
            {
            }
        }
开发者ID:Nebual,项目名称:chummer,代码行数:30,代码来源:clsUnique.cs


示例6: Create

        /// Create a Metamagic from an XmlNode and return the TreeNodes for it.
        /// <param name="objXmlMetamagicNode">XmlNode to create the object from.</param>
        /// <param name="objCharacter">Character the Gear is being added to.</param>
        /// <param name="objNode">TreeNode to populate a TreeView.</param>
        /// <param name="objSource">Source of the Improvement.</param>
        public void Create(XmlNode objXmlMetamagicNode, Character objCharacter, TreeNode objNode, Improvement.ImprovementSource objSource)
        {
            _strName = objXmlMetamagicNode["name"].InnerText;
            _strSource = objXmlMetamagicNode["source"].InnerText;
            _strPage = objXmlMetamagicNode["page"].InnerText;
            _objImprovementSource = objSource;
            if (objXmlMetamagicNode.InnerXml.Contains("<bonus>"))
            {
                _nodBonus = objXmlMetamagicNode["bonus"];

                int intRating = 1;
                if (_objCharacter.SubmersionGrade > 0)
                    intRating = _objCharacter.SubmersionGrade;
                else
                    intRating = _objCharacter.InitiateGrade;

                ImprovementManager objImprovementManager = new ImprovementManager(objCharacter);
                if (!objImprovementManager.CreateImprovements(objSource, _guiID.ToString(), _nodBonus, true, intRating, DisplayNameShort))
                {
                    _guiID = Guid.Empty;
                    return;
                }
                if (objImprovementManager.SelectedValue != "")
                    _strName += " (" + objImprovementManager.SelectedValue + ")";
            }

            objNode.Text = DisplayName;
            objNode.Tag = _guiID.ToString();
        }
开发者ID:Nebual,项目名称:chummer,代码行数:34,代码来源:clsUnique.cs


示例7: TestCyberware

        private void TestCyberware(string strFile)
        {
            string strPrefix = "";
            Improvement.ImprovementSource objSource = new Improvement.ImprovementSource();
            if (strFile == "bioware.xml")
            {
                strPrefix = "bioware";
                objSource = Improvement.ImprovementSource.Bioware;
            }
            else
            {
                strPrefix = "cyberware";
                objSource = Improvement.ImprovementSource.Cyberware;
            }

            Character objCharacter = new Character();
            XmlDocument objXmlDocument = XmlManager.Instance.Load(strFile);
            pgbProgress.Minimum = 0;
            pgbProgress.Value = 0;
            pgbProgress.Maximum = objXmlDocument.SelectNodes("/chummer/" + strPrefix + "s/" + strPrefix).Count;

            // Gear.
            foreach (XmlNode objXmlGear in objXmlDocument.SelectNodes("/chummer/" + strPrefix + "s/" + strPrefix))
            {
                pgbProgress.Value++;
                Application.DoEvents();
                try
                {
                    TreeNode objTempNode = new TreeNode();
                    Cyberware objTemp = new Cyberware(objCharacter);
                    List<Weapon> lstWeapons = new List<Weapon>();
                    List<TreeNode> lstNodes = new List<TreeNode>();
                    objTemp.Create(objXmlGear, objCharacter, GlobalOptions.CyberwareGrades.GetGrade("Standard"), objSource, 1, objTempNode, lstWeapons, lstNodes);
                    try
                    {
                        int objValue = objTemp.TotalCost;
                    }
                    catch
                    {
                        txtOutput.Text += objXmlGear["name"].InnerText + " failed TotalCost\n";
                    }
                    try
                    {
                        string objValue = objTemp.TotalAvail;
                    }
                    catch
                    {
                        txtOutput.Text += objXmlGear["name"].InnerText + " failed TotalAvail\n";
                    }
                    try
                    {
                        int objValue = objTemp.TotalAgility;
                    }
                    catch
                    {
                        txtOutput.Text += objXmlGear["name"].InnerText + " failed TotalAgility\n";
                    }
                    try
                    {
                        int objValue = objTemp.TotalBody;
                    }
                    catch
                    {
                        txtOutput.Text += objXmlGear["name"].InnerText + " failed TotalBody\n";
                    }
                    try
                    {
                        int objValue = objTemp.TotalStrength;
                    }
                    catch
                    {
                        txtOutput.Text += objXmlGear["name"].InnerText + " failed TotalStrength\n";
                    }
                    try
                    {
                        string objValue = objTemp.CalculatedCapacity;
                    }
                    catch
                    {
                        txtOutput.Text += objXmlGear["name"].InnerText + " failed CalculatedCapacity\n";
                    }
                    try
                    {
                        decimal objValue = objTemp.CalculatedESS;
                    }
                    catch
                    {
                        txtOutput.Text += objXmlGear["name"].InnerText + " failed CalculatedESS\n";
                    }
                }
                catch
                {
                    txtOutput.Text += objXmlGear["name"].InnerText + " general failure\n";
                }
            }
        }
开发者ID:hollis21,项目名称:Chummer,代码行数:96,代码来源:frmTest.cs


示例8: Load

        /// <summary>
        /// Load the Metamagic from the XmlNode.
        /// </summary>
        /// <param name="objNode">XmlNode to load.</param>
        public void Load(XmlNode objNode)
        {
            Improvement objImprovement = new Improvement();
            _guidExternalID = Guid.Parse(objNode["eguid"].InnerText);
            _guiID = Guid.Parse(objNode["guid"].InnerText);
            _strName = objNode["name"].InnerText;
            _strSource = objNode["source"].InnerText;
            _strPage = objNode["page"].InnerText;
            _blnPaidWithKarma = Convert.ToBoolean(objNode["paidwithkarma"].InnerText);
            _nodBonus = objNode["bonus"];
            _nodConditional = objNode["conditional"];
            _objImprovementSource = objImprovement.ConvertToImprovementSource(objNode["improvementsource"].InnerText);
            _strNotes = objNode["notes"].InnerText;

            if (GlobalOptions.Instance.Language != "en-us")
            {
                string strXmlFile = "";
                string strXPath = "";
                if (_objImprovementSource == Improvement.ImprovementSource.Metamagic)
                {
                    strXmlFile = "metamagic.xml";
                    strXPath = "/chummer/metamagics/metamagic";
                }
                else
                {
                    strXmlFile = "echoes.xml";
                    strXPath = "/chummer/echoes/echo";
                }

                XmlDocument objXmlDocument = XmlManager.Instance.Load(strXmlFile);
                XmlNode objMetamagicNode = objXmlDocument.SelectSingleNode(strXPath + "[id = \"" + ExternalId + "\"]");
                if (objMetamagicNode != null)
                {
                    if (objMetamagicNode["translate"] != null)
                        _strAltName = objMetamagicNode["translate"].InnerText;
                    if (objMetamagicNode["altpage"] != null)
                        _strAltPage = objMetamagicNode["altpage"].InnerText;
                }
            }
        }
开发者ID:janhelke,项目名称:chummer2,代码行数:44,代码来源:clsUnique.cs


示例9: Create

        /// Create a Metamagic from an XmlNode and return the TreeNodes for it.
        /// <param name="objXmlMetamagicNode">XmlNode to create the object from.</param>
        /// <param name="objCharacter">Character the Gear is being added to.</param>
        /// <param name="objNode">TreeNode to populate a TreeView.</param>
        /// <param name="objSource">Source of the Improvement.</param>
        /// <param name="blnCreateImprovements">Whether or not Improvements should be created.</param>
        public void Create(XmlNode objXmlMetamagicNode, Character objCharacter, TreeNode objNode, Improvement.ImprovementSource objSource, bool blnCreateImprovements = true)
        {
            _guidExternalID = Guid.Parse(objXmlMetamagicNode["id"].InnerText);
            _strName = objXmlMetamagicNode["name"].InnerText;
            _strSource = objXmlMetamagicNode["source"].InnerText;
            _strPage = objXmlMetamagicNode["page"].InnerText;
            _objImprovementSource = objSource;
            if (blnCreateImprovements)
            {
                _nodBonus = objXmlMetamagicNode["bonus"];
                _nodConditional = objXmlMetamagicNode["conditional"];

                int intRating = 1;
                if (_objCharacter.SubmersionGrade > 0)
                    intRating = _objCharacter.SubmersionGrade;
                else
                    intRating = _objCharacter.InitiateGrade;

                ImprovementManager objImprovementManager = new ImprovementManager(objCharacter);
                if (!objImprovementManager.CreateImprovements(objSource, _guiID.ToString(), _nodBonus, true, intRating, DisplayNameShort))
                {
                    _guiID = Guid.Empty;
                    return;
                }
                if (objImprovementManager.SelectedValue != "")
                    _strName += " (" + objImprovementManager.SelectedValue + ")";

                // Conditional Improvements.
                if (!objImprovementManager.CreateImprovements(objSource, _guiID.ToString(), _nodConditional, false, 1, DisplayNameShort, true))
                {
                    _guiID = Guid.Empty;
                    return;
                }
            }

            if (GlobalOptions.Instance.Language != "en-us")
            {
                string strXmlFile = "";
                string strXPath = "";
                if (_objImprovementSource == Improvement.ImprovementSource.Metamagic)
                {
                    strXmlFile = "metamagic.xml";
                    strXPath = "/chummer/metamagics/metamagic";
                }
                else
                {
                    strXmlFile = "echoes.xml";
                    strXPath = "/chummer/echoes/echo";
                }

                XmlDocument objXmlDocument = XmlManager.Instance.Load(strXmlFile);
                XmlNode objMetamagicNode = objXmlDocument.SelectSingleNode(strXPath + "[id = \"" + ExternalId + "\"]");
                if (objMetamagicNode != null)
                {
                    if (objMetamagicNode["translate"] != null)
                        _strAltName = objMetamagicNode["translate"].InnerText;
                    if (objMetamagicNode["altpage"] != null)
                        _strAltPage = objMetamagicNode["altpage"].InnerText;
                }
            }

            objNode.Text = DisplayName;
            objNode.Tag = _guiID.ToString();
        }
开发者ID:janhelke,项目名称:chummer2,代码行数:70,代码来源:clsUnique.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# InIReader类代码示例发布时间:2022-05-24
下一篇:
C# ImprovedInstantMessagePacket类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap