public string Queue(IParty party) { Unqueue(party); StringBuilder sb = new StringBuilder(); if (!party.IsSyncd) { sb.Append(AutoLevelSyncParty(party)); } var adventures = new List <IAdventure>((repository .GetByLevel(party.Level) .Where(AdventureUtils.GetCostRequirementPredicate(party)))); if (adventures.Count != 0) { sb.Append(Queue(party, adventures)); } else { sb.Append("The party does not match the requirements for any dungeons "); sb.Append("currently available!"); } return(sb.ToString()); }
public string QueueIgnoringRequirements(IParty party) { Unqueue(party); int minLevel = PartyUtils.GetLowestLevelPlayer(party).Level; IList <IAdventure> adventures = repository .Get(a => { return(a.MinimumLevel <= minLevel && AdventureUtils.GetCostRequirementPredicate(party).Invoke(a)); }); if (adventures.Count == 0) { return("A member in your party is either too low a level or cannot afford, " + "and dungeons!"); } Random rnd = new Random(); IAdventure adventure = adventures[rnd.Next(0, adventures.Count - 1)]; adventureQueue.Add(new KeyValuePair <IParty, IAdventure>(party, adventure)); return(string.Format("Your party has joined the adventure queue for {0}, which " + "will start shortly. Maximum level requirements have been ignored, Xp is capped at " + "the adventures maximum level ({1}). ", adventure.Name, adventure.MaximumLevel)); }