You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
971 B
29 lines
971 B
3 years ago
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
|
|
||
|
namespace ET
|
||
|
{
|
||
|
public partial class FunctionItemConfigCategory
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 筛选所有指定UseType的功能道具集合信息
|
||
|
/// </summary>
|
||
|
/// <param name="ids">要筛选的ID集合</param>
|
||
|
/// <param name="useType">目标ID</param>
|
||
|
/// <returns></returns>
|
||
|
public List<int> FilterFunctionItemsByUseType(List<int> ids, int useType)
|
||
|
{
|
||
|
List<int> results = new List<int>();
|
||
|
for(int i = 0; i < ids.Count; i++)
|
||
|
{
|
||
|
int id = ids[i];
|
||
|
AllItemConfig allItemConfig = AllItemConfigCategory.Instance.Get(id);
|
||
|
FunctionItemConfig itemConfig = FunctionItemConfigCategory.Instance.Get(allItemConfig.RelatedId);
|
||
|
if (itemConfig.UseType != useType) continue;
|
||
|
results.Add(id);
|
||
|
}
|
||
|
return results;
|
||
|
}
|
||
|
}
|
||
|
}
|