Example #1
0
        public override void Read(MBinaryIO io)
        {
            if (io.Version == 0)
            {
                X1 = io.Stream.ReadSingle();
                Y1 = io.Stream.ReadSingle();
                X2 = io.Stream.ReadSingle();
                Y2 = io.Stream.ReadSingle();
            }
            else
            {
                mFloat x1 = io.ReadNext() as mFloat;
                mFloat y1 = io.ReadNext() as mFloat;
                mFloat x2 = io.ReadNext() as mFloat;
                mFloat y2 = io.ReadNext() as mFloat;

                X1 = x1.Value;
                Y1 = y1.Value;
                X2 = x2.Value;
                Y2 = y2.Value;
            }
        }
Example #2
0
        public override void Read(MBinaryIO io)
        {
            if (io.Version == 0)
            {
                X      = io.Stream.ReadSingle();
                Y      = io.Stream.ReadSingle();
                Width  = io.Stream.ReadSingle();
                Height = io.Stream.ReadSingle();
            }
            else
            {
                mFloat x      = io.ReadNext() as mFloat;
                mFloat y      = io.ReadNext() as mFloat;
                mFloat width  = io.ReadNext() as mFloat;
                mFloat height = io.ReadNext() as mFloat;

                X      = x.Value;
                Y      = y.Value;
                Width  = width.Value;
                Height = height.Value;
            }
        }