Пример #1
0
        static public LevelFile deserializeFromFile(string filename)
        {
            string    text   = System.IO.File.ReadAllText(filename);
            LevelFile result = JsonConvert.DeserializeObject <LevelFile>(text);

            return(result);
        }
Пример #2
0
        private void buttonLevelEditor_Click(object sender, EventArgs e)
        {
            LevelFile level = new LevelFile();

            level.serializeToFile("test.json");
            LevelFile levelCopy = LevelFile.deserializeFromFile("test.json");

            levelCopy.serializeToFile("test2.json");
        }