/** 是否有物品位置 */ public bool hasItemPlace(SList <ItemData> list) { if (list.size() == 1) { return(hasItemPlace(list.get(0))); } _tempDic.clear(); ItemData[] values = list.getValues(); ItemData data; for (int i = 0, len = list.size(); i < len; ++i) { data = values[i]; if (!ensureNum(data.num)) { _tempDic.clear(); return(false); } //有必要 if (ItemConfig.get(data.id).totalPlusMax > 0) { _tempDic.put(data.id, data.num); } } if (!_tempDic.isEmpty()) { ItemConfig config; foreach (var kv in _tempDic.entrySet()) { config = ItemConfig.get(kv.key); //超出总上限 if ((getItemNum(kv.key) + kv.value) > config.totalPlusMax) { return(false); } } } return(hasFreeGrid(list.size())); }