internal PartyFinderListing(PartyFinder.Listing listing, DataManager dataManager, SeStringManager seStringManager) { this.objective = listing.objective; this.conditions = listing.conditions; this.dutyFinderSettings = listing.dutyFinderSettings; this.lootRules = listing.lootRules; this.searchArea = listing.searchArea; this.slots = listing.slots.Select(accepting => new PartyFinderSlot(accepting)).ToArray(); this.jobsPresent = listing.jobsPresent; Id = listing.id; ContentIdLower = listing.contentIdLower; Name = seStringManager.Parse(listing.name.TakeWhile(b => b != 0).ToArray()); Description = seStringManager.Parse(listing.description.TakeWhile(b => b != 0).ToArray()); World = new Lazy <World>(() => dataManager.GetExcelSheet <World>().GetRow(listing.world)); HomeWorld = new Lazy <World>(() => dataManager.GetExcelSheet <World>().GetRow(listing.homeWorld)); CurrentWorld = new Lazy <World>(() => dataManager.GetExcelSheet <World>().GetRow(listing.currentWorld)); Category = (Category)listing.category; RawDuty = listing.duty; Duty = new Lazy <ContentFinderCondition>(() => dataManager.GetExcelSheet <ContentFinderCondition>().GetRow(listing.duty)); DutyType = (DutyType)listing.dutyType; BeginnersWelcome = listing.beginnersWelcome == 1; SecondsRemaining = listing.secondsRemaining; MinimumItemLevel = listing.minimumItemLevel; Parties = listing.numParties; SlotsAvailable = listing.numSlots; JobsPresent = listing.jobsPresent .Select(id => new Lazy <ClassJob>(() => id == 0 ? null : dataManager.GetExcelSheet <ClassJob>().GetRow(id))) .ToArray(); }
/// <summary> /// Initializes a new instance of the <see cref="PartyFinderListing"/> class. /// </summary> /// <param name="listing">The interop listing data.</param> /// <param name="dataManager">The DataManager instance.</param> /// <param name="seStringManager">The SeStringManager instance.</param> internal PartyFinderListing(PartyFinder.Listing listing, DataManager dataManager, SeStringManager seStringManager) { this.objective = listing.Objective; this.conditions = listing.Conditions; this.dutyFinderSettings = listing.DutyFinderSettings; this.lootRules = listing.LootRules; this.searchArea = listing.SearchArea; this.slots = listing.Slots.Select(accepting => new PartyFinderSlot(accepting)).ToArray(); this.jobsPresent = listing.JobsPresent; this.Id = listing.Id; this.ContentIdLower = listing.ContentIdLower; this.Name = seStringManager.Parse(listing.Name.TakeWhile(b => b != 0).ToArray()); this.Description = seStringManager.Parse(listing.Description.TakeWhile(b => b != 0).ToArray()); this.World = new Lazy <World>(() => dataManager.GetExcelSheet <World>().GetRow(listing.World)); this.HomeWorld = new Lazy <World>(() => dataManager.GetExcelSheet <World>().GetRow(listing.HomeWorld)); this.CurrentWorld = new Lazy <World>(() => dataManager.GetExcelSheet <World>().GetRow(listing.CurrentWorld)); this.Category = (Category)listing.Category; this.RawDuty = listing.Duty; this.Duty = new Lazy <ContentFinderCondition>(() => dataManager.GetExcelSheet <ContentFinderCondition>().GetRow(listing.Duty)); this.DutyType = (DutyType)listing.DutyType; this.BeginnersWelcome = listing.BeginnersWelcome == 1; this.SecondsRemaining = listing.SecondsRemaining; this.MinimumItemLevel = listing.MinimumItemLevel; this.Parties = listing.NumParties; this.SlotsAvailable = listing.NumSlots; this.JobsPresent = listing.JobsPresent .Select(id => new Lazy <ClassJob>( () => id == 0 ? null : dataManager.GetExcelSheet <ClassJob>().GetRow(id))) .ToArray(); }