/// <summary> /// Factory method to create a new SaveDataItem. /// </summary> public static SaveDataItem Create(string dataType, string data) { var item = new SaveDataItem(); item.dataType = dataType; item.data = data; return item; }
/// <summary> /// Factory method to create a new SaveDataItem. /// </summary> public static SaveDataItem Create(string dataType, string data) { var item = new SaveDataItem(); item.dataType = dataType; item.data = data; return(item); }
/// <summary> /// Encodes the objects to be saved as a list of SaveDataItems. /// </summary public virtual void Encode(List <SaveDataItem> saveDataItems) { for (int i = 0; i < flowcharts.Count; i++) { var flowchart = flowcharts[i]; var flowchartData = FlowchartData.Encode(flowchart); var saveDataItem = SaveDataItem.Create(FlowchartDataKey, JsonUtility.ToJson(flowchartData)); saveDataItems.Add(saveDataItem); } }
/// <summary> /// Encodes the objects to be saved as a list of SaveDataItems. /// </summary public virtual void Encode(List <SaveDataItem> saveDataItems) { for (int i = 0; i < flowcharts.Count; i++) { var flowchart = flowcharts[i]; var flowchartData = FlowchartData.Encode(flowchart); var saveDataItem = SaveDataItem.Create(FlowchartDataKey, JsonUtility.ToJson(flowchartData)); saveDataItems.Add(saveDataItem); var narrativeLogItem = SaveDataItem.Create(NarrativeLogKey, FungusManager.Instance.NarrativeLog.GetJsonHistory()); saveDataItems.Add(narrativeLogItem); } }