diff --git a/NetStone.Test/Tests.cs b/NetStone.Test/Tests.cs index cbd236b..13d0992 100644 --- a/NetStone.Test/Tests.cs +++ b/NetStone.Test/Tests.cs @@ -260,9 +260,9 @@ public async Task TestFreeCompanySearch() { var query = new FreeCompanySearchQuery { - Name = "Crystal", + Name = "new", + DataCenter = "Crystal", Housing = Housing.EstateBuilt, - GrandCompany = GrandCompany.ImmortalFlames, }; var page = await this.lodestone.SearchFreeCompany(query); @@ -280,7 +280,7 @@ public async Task TestFreeCompanySearch() foreach (var searchResult in page.Results) { Console.WriteLine( - $"{page.CurrentPage}({cPages}) - {cResults} - {searchResult.Name} - {searchResult.Id}"); + $"{page.CurrentPage}({cPages}) - {cResults} - {searchResult.Name} - {searchResult.ActiveMembers} - {searchResult.Id} - {searchResult.Server} - {searchResult.Formed} - {searchResult.Active} - {searchResult.RecruitmentOpen}"); cResults++; } diff --git a/NetStone/Model/Parseables/Search/FreeCompany/FreeCompanySearchEntry.cs b/NetStone/Model/Parseables/Search/FreeCompany/FreeCompanySearchEntry.cs index cd9d1d5..063c4eb 100644 --- a/NetStone/Model/Parseables/Search/FreeCompany/FreeCompanySearchEntry.cs +++ b/NetStone/Model/Parseables/Search/FreeCompany/FreeCompanySearchEntry.cs @@ -17,7 +17,7 @@ public class FreeCompanySearchEntry : LodestoneParseable /// public FreeCompanySearchEntry(LodestoneClient client, HtmlNode rootNode, - FreeCompanySearchEntryDefinition definition) : base(rootNode) + FreeCompanySearchEntryDefinition definition) : base(rootNode) { this.client = client; this.definition = definition; @@ -56,15 +56,21 @@ public FreeCompanySearchEntry(LodestoneClient client, HtmlNode rootNode, /// /// Active status /// - public ActiveTimes Active => Parse(this.definition.Active) switch + public ActiveTimes Active => this.ActiveText switch { - "Always" => ActiveTimes.Always, - "Weekends Only" => ActiveTimes.WeekendsOnly, - "Weekdays Only" => ActiveTimes.WeekdaysOnly, + "Always" => ActiveTimes.Always, + "Weekends" => ActiveTimes.WeekendsOnly, + "Weekdays" => ActiveTimes.WeekdaysOnly, "Not specified" => ActiveTimes.All, - _ => throw new ArgumentOutOfRangeException(), + { } s => throw new ArgumentOutOfRangeException(s), }; + /// + /// Full text of active times + /// + //ToDo: fix regex + public string ActiveText => ParseInnerText(this.definition.Active)[8..]; + /// /// Active member count /// @@ -86,9 +92,9 @@ public FreeCompanySearchEntry(LodestoneClient client, HtmlNode rootNode, public Housing EstateBuild => Parse(this.definition.EstateBuilt) switch { "No Estate or Plot" => Housing.NoEstateOrPlot, - "Estate Built" => Housing.EstateBuilt, - "Plot Only" => Housing.PlotOnly, - _ => throw new ArgumentOutOfRangeException(), + "Estate Built" => Housing.EstateBuilt, + "Plot Only" => Housing.PlotOnly, + _ => throw new ArgumentOutOfRangeException(), }; /// diff --git a/NetStone/NetStone.xml b/NetStone/NetStone.xml index 09cc189..ce8b192 100644 --- a/NetStone/NetStone.xml +++ b/NetStone/NetStone.xml @@ -3348,6 +3348,11 @@ Active status + + + Full text of active times + + Active member count