private void CombineSpellbookAdditional(Player player, OGLContext context, int level = 0) { if (level == 0) { level = player.GetLevel(); } SpellPerLevel result = (from prep in SpellbookAdditionalPerLevel where prep.Level <= level orderby prep.Level descending select prep).FirstOrDefault(); if (result != null) { SpellbookAdditional = new List <string>(result.Spells); } else { SpellbookAdditional = new List <string>(); } }
public List <string> GetAdditionalList(Player player, OGLContext context, int level = 0) { if (level == 0) { level = player.GetLevel(); } SpellPerLevel result = (from prep in SpellbookAdditionalPerLevel where prep.Level <= level orderby prep.Level descending select prep).FirstOrDefault(); if (result != null) { if (result.Level != level) { result = new SpellPerLevel(level, new List <string>(result.Spells)); SpellbookAdditionalPerLevel.Add(result); return(result.Spells); } return(result.Spells); } result = new SpellPerLevel(level, new List <string>()); SpellbookAdditionalPerLevel.Add(result); return(result.Spells); }