public string GetName(RaceGenderClass raceGenderClass, int skillId) { var skill = Get(raceGenderClass, skillId); if (skill != null) { return(skill.Name); } else { return(skillId.ToString()); } }
public Skill Get(RaceGenderClass raceGenderClass, int skillId) { var comparer = new ProjectingEqualityComparer <Skill, int>(x => x.Id); foreach (var rgc2 in raceGenderClass.Fallbacks()) { if (!_data.ContainsKey(rgc2)) { continue; } var searchSkill = new Skill(skillId, raceGenderClass); var index = _data[rgc2].BinarySearch(searchSkill, comparer); if (index < 0) { index = ~index - 1; } var item = _data[rgc2][index]; return(item); } return(null); }
internal Skill(int id, RaceGenderClass raceGenderClass, string name) : this(id, raceGenderClass) { Name = name; }
internal Skill(int id, RaceGenderClass raceGenderClass) { Id = id; RaceGenderClass = raceGenderClass; }