zxl
/
CTT
forked from Cal/CTT
1
0
Fork 0
CTT/Server/Hotfix/Game/Helper/StoreHelper.cs

36 lines
1019 B
C#
Executable File

using System;
using System.Collections.Generic;
namespace ET
{
public class StoreHelper
{
public static async ETTask GetStoreInfo(Unit unit,System.Collections.Generic.List<BagMap> list)
{
try
{
Store store = await StoreComponent.Instance.Query(unit.Id);
foreach (Item item in store.StoreDic.Values)
{
if (item.IsEmpty) continue;
BagMap bagMap = new BagMap
{
Index = item.index,
NetItem = new NetItem(item)
};
if (item.ItemType == ItemType.EquipItem)
{
bagMap.EquipTransMessage = new EquipTransMessage(item.data.As<EquipItem>());
}
list.Add(bagMap);
}
}
catch (Exception e)
{
Log.Error(e);
}
}
}
}