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 = 3
  • MAX_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; if Param parses to ChairmanEvent.Parameter, creates a ResponseEffect with parsed float value (defaults to 0f on failure).
  • 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,minSeverity followed by 3× blocks of response_desc + up to 5 effect (Param,Value) pairs.
    • Description commas are replaced with } as a simple escape.

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.