本文整理汇总了C#中Armor.Equip方法的典型用法代码示例。如果您正苦于以下问题:C# Armor.Equip方法的具体用法?C# Armor.Equip怎么用?C# Armor.Equip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Armor
的用法示例。
在下文中一共展示了Armor.Equip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EquipArmor
/// <summary>
/// 穿上護甲
/// </summary>
void EquipArmor(Armor _armor)
{
//穿上裝備,如果返回false代表無法裝備
if (!_armor.Equip())
return;
Equip(_armor, true);//穿上裝備
AddArmorBuffer(_armor.BufferID);
}
示例2: AddPlayersArmorsToInventory
public static void AddPlayersArmorsToInventory(int pmPlayerId, Dictionary<string,Item> pmInventory, Player player)
{
IDbConnection dbconn = GetConnection ();
IDbCommand dbcmd = dbconn.CreateCommand();
string sqlQuery = "select a.id, a.NAME, a.AC, a.MAX_DEX, a.ICON_NAME, es.NAME FROM " +
"ARMORS a join CHARACTERS_ITEMS ci on ci.ITEM_ID = a.ID and ci.ITEM_TYPE = 2 JOIN EQUIPEMENT_SLOTS es on ci.FIELD_ID = es.ID where ci.CHARACTER_ID =" + pmPlayerId;
dbcmd.CommandText = sqlQuery;
IDataReader reader = dbcmd.ExecuteReader();
while (reader.Read ()) {
List<EquipementTypes> lvTypes = GetArmorEqTypes (reader.GetInt32 (0), dbconn);
Item lvItem = new Armor (reader.GetString(1), lvTypes,reader.GetInt32(2),reader.GetInt32(3));
lvItem.resourceImageName = reader.GetString (4);
lvItem.inventoryFieldId = reader.GetString (5);
pmInventory.Add (reader.GetString (5), lvItem);
if ("INV_ARMOR".Equals (reader.GetString (5)))
lvItem.Equip (player, false);
}
CleanUp (reader,dbcmd,dbconn);
reader = null;
dbcmd = null;
dbconn = null;
}