/** Generates a single string that represents the class's saveable data */ public string GetSaveData() { if (invInstances == null) { return(string.Empty); } System.Text.StringBuilder inventoryString = new System.Text.StringBuilder(); foreach (InvInstance invInstance in invInstances) { inventoryString.Append(InvInstance.GetSaveData(invInstance)); } if (invInstances.Count > 0) { inventoryString.Remove(inventoryString.Length - 1, 1); } return(inventoryString.ToString()); }