/// <summary> /// Parses the ongoing resource transits in the market. /// </summary> /// <param name="htmlDoc">Html</param> public static List <MerchantsUnderWay> ParseTransits(HtmlAgilityPack.HtmlDocument htmlDoc) { var formulat = htmlDoc.GetElementbyId("merchantsOnTheWay"); var underWay = new List <MerchantsUnderWay>(); TransitType transitType = default; foreach (var child in formulat.ChildNodes) { if (child.HasClass("spacer")) { transitType = Localizations.MercahntDirectionFromString(child.InnerText); continue; } else if (child.HasClass("traders")) { underWay.Add(new MerchantsUnderWay() { Arrival = DateTime.Now.Add(TimeParser.ParseTimer(child)), TargetVillageId = (int)Parser.RemoveNonNumeric(child.Descendants("td").First(x => x.HasClass("dorf")).Descendants("a").First().GetAttributeValue("href", "")), RepeatTimes = (int)Parser.RemoveNonNumeric(child.Descendants("div").First(x => x.HasClass("repeat")).InnerText), Transit = transitType, Resources = ResourceParser.ParseResourcesMerchants(child), }); } } return(underWay); }