/// <summary> /// 移除有效耐久度物品,即当耐久度归0的时候慧聪映射中移除 /// </summary> /// <param name="specialID"></param> public void LogOffDurabilityGoods(int specialID) { for (int i = 0; i < DurabilityID.Count; i++) { if (DurabilityID[i] == specialID) { DurabilityID.Remove(DurabilityID[i]); } } }
/// <summary> /// 注册拥有有效耐久度物品 /// </summary> /// <param name="goodsId">物品id</param> /// <returns></returns> public int RegisterDurabilityGoods(int goodsId) { int specialID = 0; if (DurabilityID.Count == 0) { DurabilityID.Add(1); } else { DurabilityID.Add(DurabilityID[DurabilityID.Count - 1] + 1); } specialID = DurabilityID[DurabilityID.Count - 1]; return(specialID); }