Create() public static method

Factory method to create a new SaveDataItem.
public static Create ( string dataType, string data ) : SaveDataItem
dataType string
data string
return SaveDataItem
Esempio n. 1
0
        /// <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);
            }
        }
Esempio n. 2
0
        /// <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);
            }
        }