示例#1
0
        private static string ViewReward(Reward reward, bool isClaimed = false)
        {
            if (reward == null)
            {
                return("");
            }

            var result = new StringBuilder($"> 🎁 **{Format.TryPluralize("Reward", reward.Count)}**");

            if (isClaimed)
            {
                result.Append(" (Claimed)");
            }

            result.AppendLine();

            if (reward.Money > 0)
            {
                result.AppendLine($"> {CurrencyHelper.WriteCost(reward.Money, CurrencyType.Money)}");
            }

            if (reward.Exp > 0)
            {
                result.AppendLine($"> {Icons.Exp} **{reward.Exp:##,0}**");
            }

            if (Check.NotNullOrEmpty(reward.ItemIds))
            {
                foreach ((string itemId, int amount) in reward.ItemIds)
                {
                    result.AppendLine($"> {GetItemPreview(itemId, amount)}");
                }
            }

            return(result.ToString());
        }
示例#2
0
 public static string WriteItemCost(Item item)
 {
     return(CurrencyHelper.WriteCost(GetCost(item.Value, 0), item.Currency));
 }