CTT/Server/Hotfix/Game/Helper/StoreHelper.cs

36 lines
1019 B
C#
Raw Normal View History

2021-04-08 20:09:59 +08:00

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);
2021-04-11 19:50:39 +08:00
foreach (Item item in store.StoreDic.Values)
2021-04-08 20:09:59 +08:00
{
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);
}
}
}
}