Exemple #1
0
        public void Parse(BinaryPacker.Element meta)
        {
            meta.AttrIfBool("IgnoreLevelAudioLayerData", v => IgnoreLevelAudioLayerData = v);
            meta.AttrIf("Inventory", v => Inventory               = v);
            meta.AttrIf("Path", v => Path                         = v);
            meta.AttrIf("PoemID", v => PoemID                     = v);
            meta.AttrIf("StartLevel", v => StartLevel             = v);
            meta.AttrIfBool("HeartIsEnd", v => HeartIsEnd         = v);
            meta.AttrIfBool("SeekerSlowdown", v => SeekerSlowdown = v);
            meta.AttrIfBool("TheoInBubble", v => TheoInBubble     = v);

            BinaryPacker.Element child;

            child = meta.Children?.FirstOrDefault(el => el.Name == "audiostate");
            if (child != null)
            {
                AudioState = new MapMetaAudioState(child);
            }

            child = meta.Children?.FirstOrDefault(el => el.Name == "checkpoints");
            if (child != null)
            {
                Checkpoints = new MapMetaCheckpointData[child.Children?.Count ?? 0];
                for (int i = 0; i < Checkpoints.Length; i++)
                {
                    Checkpoints[i] = new MapMetaCheckpointData(child.Children[i]);
                }
            }
        }
Exemple #2
0
        public void Parse(BinaryPacker.Element meta)
        {
            meta.AttrIf("Level", v => Level           = v);
            meta.AttrIf("Name", v => Name             = v);
            meta.AttrIfBool("Dreaming", v => Dreaming = v);
            meta.AttrIf("Inventory", v => Inventory   = v);
            meta.AttrIf("CoreMode", v => CoreMode     = (Session.CoreModes)Enum.Parse(typeof(Session.CoreModes), v, true));

            BinaryPacker.Element child;

            child = meta.Children?.FirstOrDefault(el => el.Name == "audiostate");
            if (child != null)
            {
                AudioState = new MapMetaAudioState(child);
            }

            child = meta.Children?.FirstOrDefault(el => el.Name == "flags");
            if (child != null)
            {
                Flags = new string[child.Children?.Count ?? 0];
                for (int i = 0; i < Flags.Length; i++)
                {
                    Flags[i] = child.Children[i].Attr("innerText");
                }
            }
        }
Exemple #3
0
        public void Parse(BinaryPacker.Element meta)
        {
            meta.AttrIfBool("IgnoreLevelAudioLayerData", v => IgnoreLevelAudioLayerData = v);
            meta.AttrIf("Inventory", v => Inventory   = v);
            meta.AttrIf("Path", v => Path             = v);
            meta.AttrIf("PoemID", v => PoemID         = v);
            meta.AttrIf("StartLevel", v => StartLevel = v);
            meta.AttrIf("HeartIsEnd", v => HeartIsEnd = string.IsNullOrEmpty(v) ? (bool?)null : (bool)bool.Parse(v));

            BinaryPacker.Element child;

            child = meta.Children.FirstOrDefault(el => el.Name == "audiostate");
            if (child != null)
            {
                AudioState = new MapMetaAudioState(child);
            }

            child = meta.Children.FirstOrDefault(el => el.Name == "checkpoints");
            if (child != null)
            {
                Checkpoints = new MapMetaCheckpointData[child.Children.Count];
                for (int i = 0; i < Checkpoints.Length; i++)
                {
                    Checkpoints[i] = new MapMetaCheckpointData(child.Children[i]);
                }
            }
        }