本文整理汇总了C#中Chummer.CommonFunctions.FindGear方法的典型用法代码示例。如果您正苦于以下问题:C# CommonFunctions.FindGear方法的具体用法?C# CommonFunctions.FindGear怎么用?C# CommonFunctions.FindGear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chummer.CommonFunctions
的用法示例。
在下文中一共展示了CommonFunctions.FindGear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: tsUndoNuyenExpense_Click
//.........这里部分代码省略.........
}
break;
}
// Remove any Weapon that the Cyberware created.
if (objChild.WeaponID != Guid.Empty.ToString())
{
foreach (Weapon objWeapon in _objCharacter.Weapons)
{
if (objWeapon.InternalId == objChild.WeaponID)
{
_objCharacter.Weapons.Remove(objWeapon);
break;
}
}
// Remove the TreeNode for the Weapon.
foreach (TreeNode objWeaponNode in treWeapons.Nodes[0].Nodes)
{
if (objWeaponNode.Tag.ToString() == objChild.WeaponID)
{
treWeapons.Nodes[0].Nodes.Remove(objWeaponNode);
break;
}
}
}
}
}
}
break;
case NuyenExpenseType.AddGear:
// Locate the Gear that was added.
//If the gear was already deleted manually we will not be able to locate it here
Gear objGear = objCommon.FindGear(objEntry.Undo.ObjectId, _objCharacter.Gear);
if (objGear == null)
break;
objGear.Quantity -= objEntry.Undo.Qty;
if (objGear.Quantity <= 0)
{
if (objGear.Parent != null)
objGear.Parent.Children.Remove(objGear);
else
_objCharacter.Gear.Remove(objGear);
objCommon.DeleteGear(objGear, treWeapons, _objImprovementManager);
TreeNode objNode = objCommon.FindNode(objGear.InternalId, treGear);
objNode.Remove();
}
else
{
TreeNode objNode = objCommon.FindNode(objGear.InternalId, treGear);
objNode.Text = objGear.DisplayName;
}
_objController.PopulateFocusList(treFoci);
break;
case NuyenExpenseType.AddVehicle:
// Locate the Vehicle that was added.
foreach (Vehicle objVehicle in _objCharacter.Vehicles)
{
if (objVehicle.InternalId == objEntry.Undo.ObjectId)
{
// Remove the Vehicle.
_objCharacter.Vehicles.Remove(objVehicle);
foreach (TreeNode objNode in treVehicles.Nodes[0].Nodes)