using XGame.Database; using XGame.Framework.Data; namespace FL.Data { public class ItemService : DataSingleton { public bool IsEnough(int id, int 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; } } } }