public void OrderWMInfo(WMInfo info) { info.payload.orders = info.payload.orders .Where(order => order.order_type == "sell") .Where(order => order.user.status == "online" || order.user.status == "ingame") .OrderBy(order => order.platinum) .Take(3) .ToArray(); }
public void OrderWMInfo(WMInfo info, bool isbuyer) { info.payload.orders = (isbuyer ? info.payload.orders .Where(order => order.order_type == (isbuyer ? "buy" : "sell")) .Where(order => order.user.status == "online" || order.user.status == "ingame") .OrderByDescending(order => order.platinum) : info.payload.orders .Where(order => order.order_type == (isbuyer ? "buy" : "sell")) .Where(order => order.user.status == "online" || order.user.status == "ingame") .OrderBy(order => order.platinum)) .Take(Config.Instance.WMSearchCount) .ToArray(); }
public static string ToString(WMInfo info) { var sb = new StringBuilder(); var itemItemsInSet = info.include.item.items_in_set; var item = itemItemsInSet.Where(i => i.zh.item_name != i.en.item_name).ToList().Last(); sb.AppendLine($"下面是物品: {item.zh.item_name} 按价格从小到大的{info.payload.orders.Length}条信息"); sb.AppendLine(); foreach (var order in info.payload.orders) { sb.AppendLine($"[{order.user.ingame_name}] {order.user.status}"); sb.AppendLine($"{order.order_type} {order.platinum} 白鸡"); sb.AppendLine( $"- 快捷回复: /w {order.user.ingame_name} Hi! I want to buy: {item.en.item_name} for {order.platinum} platinum. (warframe.market)"); sb.AppendLine(); } // 以后不好看了再说 return(sb.ToString().Trim()); }
public static string ToString(WMInfo info, bool withQR, bool isbuyer) { var sb = new StringBuilder(); var itemItemsInSet = info.include.item.items_in_set; var item = itemItemsInSet.Where(i => i.zh.item_name != i.en.item_name).ToList().Last(); sb.AppendLine($"下面是物品: {item.zh.item_name} 按价格{(isbuyer ? "从大到小": "从小到大")}的{info.payload.orders.Length}条 {(isbuyer ? "买家" : "卖家")} 信息"); sb.AppendLine(); foreach (var order in info.payload.orders) { sb.AppendLine($"{order.order_type} {order.platinum} 白鸡 [{order.user.ingame_name}] {order.user.status} "); if (withQR) { sb.AppendLine( $"- 快捷回复: /w {order.user.ingame_name} Hi! I want to {(isbuyer ? "sell" : "buy")}: {item.en.item_name} for {order.platinum} platinum. (warframe.market)"); } } // 以后不好看了再说 return(sb.ToString().Trim()); }
public void TranslateWMOrder(WMInfo info, string searchword) { foreach (var iteminset in info.include.item.items_in_set.Where(word => word.url_name == searchword)) { iteminset.zh.item_name = searchwordTranslator["Item"].Translate(searchword); } foreach (var order in info.payload.orders) { switch (order.order_type) { case "buy": order.order_type = "收购"; break; case "sell": order.order_type = "出售"; break; } switch (order.user.status) { case "ingame": order.user.status = "游戏内在线"; break; case "online": order.user.status = "WM在线"; break; case "offline": order.user.status = "离线"; break; } } }