public override BinaryClassChunk Serialize()
        {
            BinaryClassChunk binaryClassChunk = base.Serialize();

            binaryClassChunk.AddProperty("fireDirection", (object)this.fireDirection);
            binaryClassChunk.AddProperty("firePower", (object)this.firePower);
            return(binaryClassChunk);
        }
예제 #2
0
        public override BinaryClassChunk Serialize()
        {
            BinaryClassChunk binaryClassChunk = base.Serialize();

            binaryClassChunk.AddProperty("stanceSetting", (object)this.stanceSetting);
            binaryClassChunk.AddProperty("contains", this.contains != (System.Type)null ? (object)ModLoader.SmallTypeName(this.contains) : (object)"");
            binaryClassChunk.AddProperty("chestPlate", (object)this.chestPlate);
            binaryClassChunk.AddProperty("helmet", (object)this.helmet);
            return(binaryClassChunk);
        }
        public override BinaryClassChunk Serialize()
        {
            BinaryClassChunk binaryClassChunk = base.Serialize();

            binaryClassChunk.AddProperty("frame", (object)(this.graphic as SpriteMap).frame);
            return(binaryClassChunk);
        }
예제 #4
0
        public override BinaryClassChunk Serialize()
        {
            BinaryClassChunk binaryClassChunk = base.Serialize();

            binaryClassChunk.AddProperty("contains", (object)MysteryGun.SerializeTypeProb(this.contains));
            return(binaryClassChunk);
        }
예제 #5
0
        public void SerializeField(BinaryClassChunk element, string name)
        {
            ClassMember member = Editor.GetMember(this.GetType(), name);

            if (member == null)
            {
                return;
            }
            element.AddProperty(name, member.GetValue((object)this));
        }
        public override BinaryClassChunk Serialize()
        {
            BinaryClassChunk binaryClassChunk = new BinaryClassChunk();

            binaryClassChunk.AddProperty("type", (object)ModLoader.SmallTypeName(this.GetType()));
            binaryClassChunk.AddProperty("blockType", (object)ModLoader.SmallTypeName(this._type));
            BitBuffer bitBuffer1 = new BitBuffer(false);

            bitBuffer1.Write(this._things.Count);
            if (typeof(AutoBlock).IsAssignableFrom(this._type))
            {
                foreach (Thing thing in this._things)
                {
                    AutoBlock autoBlock = thing as AutoBlock;
                    autoBlock.groupedWithNeighbors = false;
                    autoBlock.neighborsInitialized = false;
                }
                BitBuffer bitBuffer2 = new BitBuffer(false);
                bitBuffer2.Write((ushort)0);
                ushort val = 0;
                foreach (Thing thing in this._things)
                {
                    AutoBlock autoBlock = thing as AutoBlock;
                    autoBlock.InitializeNeighbors();
                    bitBuffer1.Write(thing.x);
                    bitBuffer1.Write(thing.y);
                    bitBuffer1.Write((byte)thing.frame);
                    bitBuffer1.Write(autoBlock.upBlock != null ? (short)this._things.IndexOf((Thing)autoBlock.upBlock) : (short)-1);
                    bitBuffer1.Write(autoBlock.downBlock != null ? (short)this._things.IndexOf((Thing)autoBlock.downBlock) : (short)-1);
                    bitBuffer1.Write(autoBlock.rightBlock != null ? (short)this._things.IndexOf((Thing)autoBlock.rightBlock) : (short)-1);
                    bitBuffer1.Write(autoBlock.leftBlock != null ? (short)this._things.IndexOf((Thing)autoBlock.leftBlock) : (short)-1);
                    BlockGroup blockGroup = autoBlock.GroupWithNeighbors(false);
                    if (blockGroup != null)
                    {
                        bitBuffer2.Write(blockGroup.x);
                        bitBuffer2.Write(blockGroup.y);
                        bitBuffer2.Write(blockGroup.collisionOffset.x);
                        bitBuffer2.Write(blockGroup.collisionOffset.y);
                        bitBuffer2.Write(blockGroup.collisionSize.x);
                        bitBuffer2.Write(blockGroup.collisionSize.y);
                        bitBuffer2.Write(blockGroup.blocks.Count <Block>());
                        foreach (Block block in blockGroup.blocks)
                        {
                            bitBuffer2.Write((short)this._things.IndexOf((Thing)block));
                        }
                        ++val;
                    }
                }
                bitBuffer2.position = 0;
                bitBuffer2.Write(val);
                foreach (Thing thing in this._things)
                {
                    AutoBlock autoBlock = thing as AutoBlock;
                    autoBlock.groupedWithNeighbors = false;
                    autoBlock.neighborsInitialized = false;
                }
                if (bitBuffer2.lengthInBytes > 2)
                {
                    binaryClassChunk.AddProperty("groupData", (object)bitBuffer2);
                }
            }
            else
            {
                foreach (Thing thing in this._things)
                {
                    bitBuffer1.Write(thing.x);
                    bitBuffer1.Write(thing.y);
                    bitBuffer1.Write((byte)thing.frame);
                }
            }
            binaryClassChunk.AddProperty("data", (object)bitBuffer1);
            return(binaryClassChunk);
        }