Exemplo n.º 1
0
        public void Deserialize(LevelDeserializeContext context)
        {
            position = context.br.ReadPosition();
            int count = context.br.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                properties.Add(context.br.ReadString(), context.br.ReadString());
            }
        }
Exemplo n.º 2
0
        /// <summary>Deserialize into new object instance</summary>
        public Teleporter(LevelDeserializeContext context)
        {
            TargetLevel = context.br.ReadNullableString();
            if (TargetLevel != null)
            {
                TargetLevel = TargetLevel.ToLowerInvariant();
            }
            targetSpawn = context.br.ReadNullableString();

            if (context.Version >= 18)
            {
                neverSelectAtRandom = context.br.ReadBoolean();
            }

            base.Deserialize(context);
        }
Exemplo n.º 3
0
        /// <summary>Deserialize into new object instance</summary>
        public Thing(LevelDeserializeContext context)
        {
            AnimationSet = context.ReadAnimationSet();

            Position   = context.br.ReadPosition();
            FacingLeft = context.br.ReadBoolean();

            overrideBehaviour = context.br.ReadNullableString();

            includeInNavigation = context.br.ReadBoolean();

            // Properties
            {
                int count = context.br.ReadInt32();
                for (int i = 0; i < count; i++)
                {
                    properties.Add(context.br.ReadString(), context.br.ReadString());
                }
            }
        }
Exemplo n.º 4
0
        protected void Deserialize(LevelDeserializeContext context)
        {
            mask = new MaskData(context.br, context.FastReadHack);

            if (context.Version >= 15)
            {
                startY = context.br.ReadInt32();
                endY   = context.br.ReadInt32();

                if (context.Version < 17 && endY != beforeVersion17WorldPhysicsMaximumHeight)
                {
                    endY++; // <- Old version had an inclusive upper bound
                }
            }
            else
            {
                startY = 0;
                endY   = WorldPhysics.MaximumHeight;
            }

            regionIndex = context.nextRegionIndex++;
        }
Exemplo n.º 5
0
        public Shim(LevelDeserializeContext context)
        {
            AnimationSet       = context.ReadAnimationSet();
            Position           = context.br.ReadPosition();
            FacingLeft         = context.br.ReadBoolean();
            parallaxX          = context.br.ReadSingle();
            parallaxY          = context.br.ReadSingle();
            animationNumber    = context.br.ReadInt32();
            ambientSoundSource = context.br.ReadNullableString();

            if (context.Version >= 14)
            {
                tag = context.br.ReadInt32();
            }

            if (context.Version >= 16)
            {
                int count = context.br.ReadInt32();
                for (int i = 0; i < count; i++)
                {
                    properties.Add(context.br.ReadString(), context.br.ReadString());
                }
            }
        }
Exemplo n.º 6
0
 /// <summary>Deserialize into new object instance</summary>
 public Region(LevelDeserializeContext context)
 {
     Deserialize(context);
 }
Exemplo n.º 7
0
 /// <summary>Deserialize into new object instance</summary>
 public LevelPosition(LevelDeserializeContext context)
 {
     Deserialize(context);
 }