Пример #1
0
        protected override void WriteDelta(BinaryWriter writer)
        {
            texture = new NetTexture2DExtended(Value.getExtendedTexture());
            texture.Write(writer);

            which = new NetInt(Value.ParentSheetIndex);
            which.Write(writer);

            tilePos = new NetVector2(Value.TileLocation);
            tilePos.Write(writer);

            InventoryMaxSize = new NetInt(Value.inventoryMaxSize);
            InventoryMaxSize.Write(writer);

            sourceRect = new NetRectangle(Value.sourceRect);
            sourceRect.Write(writer);

            boundingBox = new NetRectangle(Value.boundingBox.Value);
            sourceRect.Write(writer);

            drawPosition = new NetVector2(Value.drawPosition);
            drawPosition.Write(writer);

            locationName = new NetString(Value.locationsName);
            locationName.Write(writer);

            /*
             * if (Value.animationManager == null)
             * {
             *  throw new Exception("WTF, why is the animation manager null???????????");
             * }
             * animationManager = new NetAnimationManager(Value.animationManager);
             * animationManager.Write(writer);
             */
        }
Пример #2
0
        protected override void ReadDelta(BinaryReader reader, NetVersion version)
        {
            texture = new NetTexture2DExtended();
            texture.Read(reader, version);

            Value.setExtendedTexture(texture.Value);

            which = new NetInt();
            which.Read(reader, version);
            Value.ParentSheetIndex = which.Value;

            tilePos = new NetVector2();
            tilePos.Read(reader, version);
            Value.TileLocation = tilePos.Value;

            InventoryMaxSize = new NetInt();
            InventoryMaxSize.Read(reader, version);
            Value.inventoryMaxSize = InventoryMaxSize.Value;

            sourceRect = new NetRectangle();
            sourceRect.Read(reader, version);
            Value.sourceRect = sourceRect.Value;

            boundingBox = new NetRectangle();
            boundingBox.Read(reader, version);
            Value.boundingBox.Value = boundingBox.Value;

            drawPosition = new NetVector2();
            drawPosition.Read(reader, version);
            Value.drawPosition = drawPosition.Value;

            locationName = new NetString();
            locationName.Read(reader, version);
            Value.locationsName = locationName.Value;
            Value.thisLocation  = Game1.getLocationFromName(locationName.Value);

            /*
             * animationManager = new NetAnimationManager();
             * animationManager.Read(reader, version);
             * Value.animationManager = animationManager.Value;
             */
        }