Example #1
0
        public EncounterOption ToEncounterOption(int index, EncounterOptionDisplayType displayType)
        {
            var option = new EncounterOption();

            option.description = description;

            switch (displayType)
            {
            case EncounterOptionDisplayType.Numbers:
                option.displayIcon = EmojiUtils.emojiNumbers[index];
                break;

            case EncounterOptionDisplayType.Next:
                option.displayIcon = EmojiUtils.ArrowRight;
                break;

            case EncounterOptionDisplayType.Explicit:
                if (display == null)
                {
                    throw new InvalidEncounterException($"Explicit icon display was chosen but no icon was present in option {index}.");
                }
                option.displayIcon = DiscordEmoji.FromName(Bot.Instance.Client, $":{display}:");
                break;
            }

            option.action = action.ToEncounterAction();

            return(option);
        }
Example #2
0
        public EncounterOption[] ToEncounterOptions()
        {
            var results = new EncounterOption[options.Length];

            for (int i = 0; i < options.Length; i++)
            {
                results[i] = options[i].ToEncounterOption(i, displayType);
            }

            return(results);
        }