using System; using System.Collections.Generic; using ImGuiNET; namespace ExpandedSearchInfo.Sections { public class RefsheetSection : ISearchInfoSection { public string Name { get; } public Uri Uri { get; } private List> Attributes { get; } private string Notes { get; } private List> Cards { get; } internal RefsheetSection(string name, Uri uri, List> attributes, string notes, List> cards) { this.Name = name; this.Uri = uri; this.Attributes = attributes; this.Notes = notes; this.Cards = cards; } public void Draw() { if (ImGui.CollapsingHeader($"Attributes##{this.Name}")) { foreach (var (key, value) in this.Attributes) { ImGui.TextUnformatted($"{key}: {value}"); } } if (ImGui.CollapsingHeader($"Notes##{this.Name}")) { Util.DrawLines(this.Notes); } foreach (var (cardName, cardContent) in this.Cards) { if (!ImGui.CollapsingHeader($"{cardName}##{this.Name}")) { continue; } Util.DrawLines(cardContent); } } } }