Detailed Method Reference
Namespace: Canley.Utility.CSV.Standard
Class: CSVTable<T>
Definition
public bool SaveTable(CanleyCSVManager manager)-
Description: Automatically resolves the target file name using the Hierarchy of Truth (Memory, Inspector, Class Name) and delegates to the path-based save routine.
-
Workflow:
- Memory Check: Evaluates the active file name stored from the last successful load operation.
- Fallback Resolution: Falls back to the manager’s target file slot if memory is empty, or defaults to the C# class name (
typeof(T).Name) as a final safety net. - Extension Enforcement: Appends a
.csvextension if one is missing from the target string. - Delegation: Forwards the resolved path and manager instance to the core file persistence overload.
-
Parameters:
manager: TheCanleyCSVManagerinstance handling file I/O operations.
-
Returns:
bool- Returnstrueif the file write operation succeeds;falseotherwise. -
Example:
public void AutoSaveInventory(CSVTable<ItemRecord> inventoryTable, CanleyCSVManager csvManager)
{
bool success = inventoryTable.SaveTable(csvManager);
if (success)
{
Debug.Log(message: "Inventory automatically saved using resolved naming conventions.");
}
}TIP
Use this parameterless overload for standard game saves or auto-saves where you want the table to automatically figure out the correct file name based on its load history or class structure.