示例#1
0
        public void Deserialize(string jsonData)
        {
            if (!initialized)
            {
                throw new InvalidOperationException("Not initialized!");
            }

            EngineSerializerData data = jsonData.Deserialize <EngineSerializerData>();

            Restore(data);
            data.Dispose();
        }
示例#2
0
        public void Restore(EngineSerializerData data)
        {
            if (!initialized)
            {
                throw new InvalidOperationException("Not initialized!");
            }

            for (int i = 0; i < ValueWrappers.Count; i++)
            {
                ValueWrappers.Array[i].Restore(data.ValueData.Array[i]);
            }
        }
示例#3
0
        public string Serialize()
        {
            if (!initialized)
            {
                throw new InvalidOperationException("Not initialized!");
            }

            EngineSerializerData data = new EngineSerializerData(ValueWrappers);
            string str = data.Serialize();

            data.Dispose();
            return(str);
        }