using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
|
public partial class EquipStarConfig : IConfigPostProcess
|
{
|
|
static Dictionary<int, List<EquipStarConfig>> equipStarConfigs = new Dictionary<int, List<EquipStarConfig>>();
|
|
public void OnConfigParseCompleted()
|
{
|
var key = Level * 10000 + EquipPlace * 100;
|
|
if (!equipStarConfigs.ContainsKey(key))
|
{
|
equipStarConfigs[key] = new List<EquipStarConfig>();
|
}
|
equipStarConfigs[key].Add(this);
|
}
|
|
public static EquipStarConfig Get(int level, int equipPlace, int star)
|
{
|
var key = level * 10000 + equipPlace * 100;
|
if (equipStarConfigs.ContainsKey(key))
|
{
|
var configs = equipStarConfigs[key];
|
foreach (var item in configs)
|
{
|
if (item.Star == star)
|
{
|
return item;
|
}
|
}
|
|
return null;
|
}
|
else
|
{
|
return null;
|
}
|
}
|
|
public static List<EquipStarConfig> GetConfigs(int level, int equipPlace)
|
{
|
var key = level * 10000 + equipPlace * 100;
|
if (equipStarConfigs.ContainsKey(key))
|
{
|
return equipStarConfigs[key];
|
}
|
else
|
{
|
return null;
|
}
|
}
|
|
}
|