using Core.Entities; namespace Core.Printing; public sealed record EventMark( string Symbol, string Label, string Color, Func Applies); /// /// Compact event-attribute marks used on the event-ranking index chip, /// print badges, and the shared legend. /// public static class EventAttributeMarks { public const string LevelOfEffort1 = "○"; public const string LevelOfEffort2 = "◐"; public const string LevelOfEffort3 = "⬤"; public const string Individual = "ⓘ"; public const string OnSite = "ⓐ"; public const string Regional = "ⓡ"; public const string Presubmission = "ⓟ"; public static readonly IReadOnlyList LegendItems = [ new(LevelOfEffort1, "Level of Effort: 1", "#757575", e => e.LevelOfEffort == 1), new(LevelOfEffort2, "Level of Effort: 2", "#616161", e => e.LevelOfEffort == 2), new(LevelOfEffort3, "Level of Effort: 3", "#424242", e => e.LevelOfEffort == 3), new(Individual, "Individual Event", "#9c27b0", e => e.EventFormat == EventFormat.Individual), new(OnSite, "On-Site Activity", "#ff9800", e => e.OnSiteActivity), new(Regional, "Regional Event", "#2196f3", e => e.RegionalEvent), new(Presubmission, "Presubmission", "#4caf50", e => e.Presubmission) ]; public static string For(EventDefinition? evt) { if (evt is null) return string.Empty; return string.Join( " ", LegendItems.Where(m => m.Applies(evt)).Select(m => m.Symbol)); } }