Ejemplo n.º 1
0
        private void Load(IFileStore store)
        {
            var kvp = new KeyValuePairs();

            using (var reader = store.OpenTextFile(m_path))
            {
                kvp.Load(reader);
            }

            if (kvp.Count == 0)
            {
                LegacyLoad(store);
            }
            else
            {
                // Read in the title and levels
                m_title = kvp.GetString("title", "Untitled Campaign");
                m_levels.AddRange(kvp.GetStringArray("levels", new string[0]));
                m_checkpoints.AddRange(kvp.GetIntegerArray("checkpoints", new int[0]));
                m_id = kvp.GetInteger("id", MathUtils.SimpleStableHash(m_path));
                m_initialLevelsUnlocked = kvp.GetInteger("initial_levels_unlocked", 1);
                m_hidden = kvp.GetBool("hidden", false);
            }
        }