123456789101112131415161718192021222324252627282930 |
- using XGame.Database;
- using XGame.Framework.Data;
- namespace FL.Data
- {
- public class ItemService : DataSingleton<ItemService>
- {
- public bool IsEnough(int id, long needNum, bool showTips)
- {
- var num = ItemData.Instance.GetItemNum(id);
- if (needNum > num)
- {
- if (showTips)
- {
- var table = ItemTableRepo.Get(id);
- if (table != null)
- EventSingle.Instance.Notify(
- EventDefine.ShowTips,
- string.Format(StringDefine.itemNotEnough, table.Name)
- );
- }
- return false;
- }
- else
- {
- return true;
- }
- }
- }
- }
|