Detailed Method Reference

Namespace: Canley.Utility.CSV.Standard
Class: CSVTable<T>

Definition

public void LoadPolymorphic(CanleyCSVManager manager, string typeColumn = "ClassName")
  • Description: An advanced loading method supporting heterogeneous data types by inspecting a specific column to determine which subclass of T to instantiate for every individual row.

  • Workflow:

    1. Hierarchy & Pipeline: Follows the identical filename discovery and smart-load pipeline as standard loads.
    2. Type Column Discovery: Scans the header row to locate the specified type column index.
    3. Reflection Resolution: Searches loaded assemblies for concrete types matching the row’s type name and inheriting from T.
    4. Polymorphic Hydration: Instantiates the resolved subclass and processes hydration and meta finalisation.
  • Parameters:

    • manager: The CanleyCSVManager instance handling file I/O operations.
    • typeColumn: The string name of the CSV column determining subclass types (defaults to "ClassName").
  • Returns: void

  • Example:

public void LoadAbilities(CSVTable<AbilityRecord> abilityTable, CanleyCSVManager csvManager)
{
    abilityTable.LoadPolymorphic(csvManager, "EffectType");
}

TIP

Use LoadPolymorphic when you need to mix different data types (such as various weapon and armor subclasses) together within a single unified dataset file.