ReadFrom() public static method

public static ReadFrom ( BinaryReader reader ) : ReducedQuadInfo
reader System.IO.BinaryReader
return ReducedQuadInfo
Ejemplo n.º 1
0
        public static ReducedLayerInfo ReadFrom(BinaryReader reader, int version)
        {
            ReducedLayerInfo toReturn = new ReducedLayerInfo();

            toReturn.Z = reader.ReadSingle();

            toReturn.Texture = reader.ReadString();

            toReturn.Name = reader.ReadString();

            toReturn.NumberOfQuads = reader.ReadUInt32();

            for (int i = 0; i < toReturn.NumberOfQuads; i++)
            {
                toReturn.Quads.Add(ReducedQuadInfo.ReadFrom(reader));
            }

            if (version >= 2)
            {
                toReturn.TextureId = reader.ReadInt32();
            }

            if (version >= 3)
            {
                toReturn.ParallaxMultiplierX = reader.ReadSingle();
                toReturn.ParallaxMultiplierY = reader.ReadSingle();

                toReturn.CameraOffsetX = reader.ReadSingle();
                toReturn.CameraOffsetY = reader.ReadSingle();
            }

            return(toReturn);
        }
Ejemplo n.º 2
0
        public static ReducedLayerInfo ReadFrom(BinaryReader reader)
        {
            ReducedLayerInfo toReturn = new ReducedLayerInfo();


            toReturn.Texture       = reader.ReadString();
            toReturn.NumberOfQuads = reader.ReadUInt32();

            for (int i = 0; i < toReturn.NumberOfQuads; i++)
            {
                toReturn.Quads.Add(ReducedQuadInfo.ReadFrom(reader));
            }

            return(toReturn);
        }