Exemplo n.º 1
0
        public void SaveGraph(string path, StateGraph stateGraph)
        {
            StorageAdapter storageAdapter = new StorageAdapter();

            storageAdapter.Add(stateGraph.GetType().ToString());
            storageAdapter.Add(stateGraph.Encode());
        }
Exemplo n.º 2
0
        //保存到文件
        public static void SaveToStorage(string filePath, ITPSerializable target)
        {
            StorageAdapter storageAdapter = new StorageAdapter();

            storageAdapter.Add(target.EncodeFirst());
            storageAdapter.Add(target.EncodeSecond());
            WriteToFile(filePath, storageAdapter.ToJson());
        }
Exemplo n.º 3
0
        public StorageAdapter EncodeSecond()
        {
            StorageAdapter storageAdapter = new StorageAdapter();

            storageAdapter.Add(Body.EncodeSecond());
            storageAdapter.Add(mOutport.EncodeSecond());
            storageAdapter.Add(EncodeRef());
            return(storageAdapter);
        }
Exemplo n.º 4
0
        public StorageAdapter EncodeFirst()
        {
            StorageAdapter storageAdapter = new StorageAdapter();

            storageAdapter.Add(Body.EncodeFirst());
            storageAdapter.Add(mOutport.EncodeFirst());
            storageAdapter.Add(EncodeContent());
            return(storageAdapter);
        }