ChairmanEventCSVHandler
Overview
Utility for importing/exporting ChairmanEvent data from/to CSV files. Read flow parses 3 responses per event with up to 5 effects each; write flow emits a header + rows including BackgroundPath.
Constants
RESPONSES = 3MAX_EFFECTS_PER_RESPONSE = 5
ReadEventsFromCSV(string path)
- Reads all lines.
- Skips header (starts at index 1).
- Splits row by semicolon
;and maps fields:- Title, Description, ImagePath, BackgroundPath, Nature, Personality, MinSeverity.
- For each of the 3 responses:
- Reads
response_desc. - Reads up to 5
(Param, Value)pairs; ifParamparses toChairmanEvent.Parameter, creates aResponseEffectwith parsedfloatvalue (defaults to0fon failure).
- Reads
- Returns
List<ChairmanEvent>.
WriteEventsToCSV(List events, string path)
- Writes a comma-separated header including BackgroundPath after ImagePath.
- For each event:
- Emits
title,escapedDesc,img,background,nature,personality,minSeverityfollowed by 3× blocks ofresponse_desc+ up to 5 effect(Param,Value)pairs. - Description commas are replaced with
}as a simple escape.
- Emits
Notes
- The reader uses
;-split while the writer uses comma-separated fields. Keep your pipeline consistent or adjust one side to match your authoring tool.