public static void SortPediaCategory(PediaCategory category, IComparer <PediaDirector.Id> comparer) { var cat = GetCategory(category).ToList(); cat.Sort(comparer); GetCategory(category) = cat.ToArray(); }
public static void SetPediaCategory(PediaDirector.Id id, PediaCategory category) { var cat = GetCategory(category).ToList(); cat.Add(id); GetCategory(category) = cat.ToArray(); }
static ref PediaDirector.Id[] GetCategory(PediaCategory cat) { switch (cat) { case PediaCategory.TUTORIALS: return(ref PediaUI.TUTORIALS_ENTRIES); case PediaCategory.SLIMES: return(ref PediaUI.SLIMES_ENTRIES); case PediaCategory.RESOURCES: return(ref PediaUI.RESOURCES_ENTRIES); case PediaCategory.RANCH: return(ref PediaUI.RANCH_ENTRIES); case PediaCategory.WORLD: return(ref PediaUI.WORLD_ENTRIES); case PediaCategory.SCIENCE: return(ref PediaUI.SCIENCE_ENTRIES); } throw new Exception(); }