Exemple #1
0
        public static string WriteReward(Reward reward)
        {
            var info = new StringBuilder();

            if (reward.Money > 0)
            {
                info.AppendLine($"> • {Icons.Balance} **{reward.Money:##,0}**");
            }

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

            if (!Check.NotNullOrEmpty(reward.ItemIds))
            {
                return(info.ToString());
            }

            foreach ((string itemId, int amount) in reward.ItemIds)
            {
                string counter = amount > 1 ? $" (x**{amount:##,0}**)" : "";
                info.AppendLine($"> • {ItemHelper.IconOf(itemId)}{ItemHelper.NameOf(itemId)}{counter}");
            }

            return(info.ToString());
        }
Exemple #2
0
        private static string WriteItem(string itemId, int amount)
        {
            Item   item = ItemHelper.GetItem(itemId);
            string icon = ItemHelper.IconOf(itemId);
            string name = Check.NotNull(icon) ? item.Name : item.GetName();

            return($"{(Check.NotNull(icon) ? $"{icon} " : "• ")}{name}{(amount > 1 ? $" (x**{amount:##,0}**)" : "")}");
        }