本文整理汇总了C#中Chummer.ImprovementManager.CreateImprovement方法的典型用法代码示例。如果您正苦于以下问题:C# ImprovementManager.CreateImprovement方法的具体用法?C# ImprovementManager.CreateImprovement怎么用?C# ImprovementManager.CreateImprovement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chummer.ImprovementManager
的用法示例。
在下文中一共展示了ImprovementManager.CreateImprovement方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateArmorRating
/// <summary>
/// Update the label and tooltip for the character's Armor Rating.
/// </summary>
/// <param name="lblArmor"></param>
/// <param name="tipTooltip"></param>
protected void UpdateArmorRating(Label lblArmor, ToolTip tipTooltip, ImprovementManager _objImprovementManager)
{
// Armor Ratings.
lblArmor.Text = _objCharacter.TotalArmorRating.ToString();
string strArmorToolTip = "";
strArmorToolTip = LanguageManager.Instance.GetString("Tip_Armor") + " (" + _objCharacter.ArmorRating.ToString() + ")";
if (_objCharacter.ArmorRating != _objCharacter.TotalArmorRating)
strArmorToolTip += " + " + LanguageManager.Instance.GetString("Tip_Modifiers") + " (" +
(_objCharacter.TotalArmorRating - _objCharacter.ArmorRating).ToString() + ")";
tipTooltip.SetToolTip(lblArmor, strArmorToolTip);
// Remove any Improvements from Armor Encumbrance.
_objImprovementManager.RemoveImprovements(Improvement.ImprovementSource.ArmorEncumbrance, "Armor Encumbrance");
// Create the Armor Encumbrance Improvements.
if (_objCharacter.ArmorEncumbrance < 0)
{
_objImprovementManager.CreateImprovement("AGI", Improvement.ImprovementSource.ArmorEncumbrance, "Armor Encumbrance", Improvement.ImprovementType.Attribute, "", 0, 1, 0, 0, _objCharacter.ArmorEncumbrance);
_objImprovementManager.CreateImprovement("REA", Improvement.ImprovementSource.ArmorEncumbrance, "Armor Encumbrance", Improvement.ImprovementType.Attribute, "", 0, 1, 0, 0, _objCharacter.ArmorEncumbrance);
}
}
示例2: AddFreeSkills
private void AddFreeSkills(int intFreeLevels)
{
ImprovementManager manager = new ImprovementManager(_objCharacter);
var type = "Aspected Magician".Equals(cboTalents.SelectedValue) ? Improvement.ImprovementType.SkillGroupBase : Improvement.ImprovementType.SkillBase;
if (cboSkill1.Visible)
{
manager.CreateImprovement(cboSkill1.Text, Improvement.ImprovementSource.Heritage, "Heritage", type, "", intFreeLevels);
}
if (cboSkill2.Visible)
{
manager.CreateImprovement(cboSkill2.Text, Improvement.ImprovementSource.Heritage, "Heritage", type, "", intFreeLevels);
}
manager.Commit();
}