示例#1
0
        public override void Deserialize(BinaryReader reader)
        {
            base.Deserialize(reader);
            var length = reader.ReadInt32();

            Objects  = VMSerializableUtils.ToTArray <short>(reader.ReadBytes(length * 2));
            Graphics = reader.ReadBytes(length);
        }
        public void Deserialize(BinaryReader reader)
        {
            LightType = (TerrainType)reader.ReadByte();
            DarkType  = (TerrainType)reader.ReadByte();
            var dat = reader.ReadBytes(reader.ReadInt32());

            if (Version > 18)
            {
                Heights = VMSerializableUtils.ToTArray <short>(dat);
            }
            else
            {
                Heights = Array.ConvertAll(dat, x => (short)x);
            }

            GrassState = reader.ReadBytes(reader.ReadInt32());
        }