From b9efca3b83ae08ceeadd22f0800ae003ece4ff01 Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期一, 28 一月 2019 14:36:37 +0800
Subject: [PATCH] 2963 【1.5.200】添加虚拟背包物品数量接口
---
System/GatheringSoul/VirtualPackModel.cs | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/System/GatheringSoul/VirtualPackModel.cs b/System/GatheringSoul/VirtualPackModel.cs
index 1b4769f..4e2e2c3 100644
--- a/System/GatheringSoul/VirtualPackModel.cs
+++ b/System/GatheringSoul/VirtualPackModel.cs
@@ -63,6 +63,25 @@
return capacity;
}
+ public int GetItemCountById(PackType packType, int id)
+ {
+ var count = 0;
+ List<int> list;
+ if (TryGetItems(packType, out list))
+ {
+ for (int i = 0; i < list.Count; i++)
+ {
+ VirtualPackItem item;
+ if (TryGetItem(packType, list[i], out item)
+ && item.id == id)
+ {
+ count++;
+ }
+ }
+ }
+ return count;
+ }
+
public bool TryGetItems(PackType packType, out List<int> list)
{
list = new List<int>();
--
Gitblit v1.8.0