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); }
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); }