Encode() public static method

Encodes the data in a Flowchart into a structure that can be stored by the save system.
public static Encode ( Flowchart flowchart ) : FlowchartData
flowchart Flowchart
return FlowchartData
Exemplo 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);
            }
        }
Exemplo 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);
            }
        }