SerializeInto() public method

public SerializeInto ( BinaryWriter writer ) : void
writer System.IO.BinaryWriter
return void
Esempio n. 1
0
        public virtual void SerializeInto(BinaryWriter writer)
        {
            writer.Write(ObjectID);
            writer.Write(PersistID);
            PlatformState.SerializeInto(writer);
            writer.Write(ObjectData.Length);
            writer.Write(VMSerializableUtils.ToByteArray(ObjectData));
            //foreach (var item in ObjectData) writer.Write(item);
            writer.Write(MyList.Length);
            writer.Write(VMSerializableUtils.ToByteArray(MyList));
            //foreach (var item in MyList) writer.Write(item);

            writer.Write(Headline != null);
            if (Headline != null)
            {
                Headline.SerializeInto(writer);
            }

            writer.Write(GUID);
            writer.Write(MasterGUID);

            writer.Write(MainParam); //parameters passed to main on creation.
            writer.Write(MainStackOBJ);

            writer.Write(Contained.Length); //object ids
            writer.Write(VMSerializableUtils.ToByteArray(Contained));
            //foreach (var item in Contained) writer.Write(item);
            writer.Write(Container);
            writer.Write(ContainerSlot);

            writer.Write(Attributes.Length);
            writer.Write(VMSerializableUtils.ToByteArray(Attributes));
            //foreach (var item in Attributes) writer.Write(item);
            writer.Write(MeToObject.Length);
            foreach (var item in MeToObject)
            {
                item.SerializeInto(writer);
            }
            writer.Write(MeToPersist.Length);
            foreach (var item in MeToPersist)
            {
                item.SerializeInto(writer);
            }

            writer.Write(DynamicSpriteFlags); /** Used to show/hide dynamic sprites **/
            writer.Write(DynamicSpriteFlags2);
            Position.SerializeInto(writer);

            writer.Write(TimestampLockoutCount);
            writer.Write(LightColor.PackedValue);
        }
Esempio n. 2
0
        public virtual void SerializeInto(BinaryWriter writer)
        {
            writer.Write(ObjectID);
            writer.Write(PersistID);
            writer.Write(ObjectData.Length);
            foreach (var item in ObjectData)
            {
                writer.Write(item);
            }
            writer.Write(MyList.Length);
            foreach (var item in MyList)
            {
                writer.Write(item);
            }

            writer.Write(Headline != null);
            if (Headline != null)
            {
                Headline.SerializeInto(writer);
            }

            writer.Write(GUID);
            writer.Write(MasterGUID);

            writer.Write(MainParam); //parameters passed to main on creation.
            writer.Write(MainStackOBJ);

            writer.Write(Contained.Length); //object ids
            foreach (var item in Contained)
            {
                writer.Write(item);
            }
            writer.Write(Container);
            writer.Write(ContainerSlot);

            writer.Write(Attributes.Length);
            foreach (var item in Attributes)
            {
                writer.Write(item);
            }
            writer.Write(MeToObject.Length);
            foreach (var item in MeToObject)
            {
                item.SerializeInto(writer);
            }

            writer.Write(DynamicSpriteFlags); /** Used to show/hide dynamic sprites **/
            Position.SerializeInto(writer);
        }