private string GetTransaction() { string money = WriteValue(Last.Value); string item = $"**{Format.Separate(Last.Count)}** {Format.TryPluralize("item", Last.Count)}"; return(State switch { MarketState.BuyComplete => $"Bought {item} for {money}.", MarketState.SellComplete => $"Sold {item} for {money}.", MarketState.SellRevert => $"Returned {money} for {item}.", _ => "INVALID_TRANSACTION" });
private string GetItemSummary(Item item, int amount = 1, bool isSellable = false) { bool isSoldOut = amount == 0 && !isSellable; StringBuilder summary = new StringBuilder(); summary.Append("> "); if (isSoldOut) { summary.Append("~~"); } summary.Append($"[`{item.Id}`] "); summary.Append(isSoldOut ? "*" : "**"); summary.Append(item.Name); summary.Append(isSoldOut ? "*~~ " : "** "); if (isSoldOut) { summary.Append("• **(Sold Out)**"); return(summary.ToString()); } if (amount > 1 && isSellable) { summary.Append($"(x{Format.Separate(amount)}) "); } summary.Append($"• {WriteValue(GetItemValue(item, isSellable))}"); if (!isSellable) { summary.Append($" (**{Format.Separate(amount)} in stock**)"); } return(summary.ToString()); }