Example #1
0
        /// <summary>
        /// Serializes content to the writer
        /// </summary>
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            base.InternalToBinary(writer);

            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            int count = Layers?.Count() ?? 0;

            writer.WriteInt(count);
            for (int i = 0; i < count; i++)
            {
                Layers[i].ToBinary(writer);
            }

            writer.WriteFloat(CellLowestElev);
            writer.WriteFloat(CellHighestElev);
            writer.WriteFloat(CellLastElev);
            writer.WriteFloat(CellFirstElev);
            writer.WriteFloat(CellLowestCompositeElev);
            writer.WriteFloat(CellHighestCompositeElev);
            writer.WriteFloat(CellLastCompositeElev);
            writer.WriteFloat(CellFirstCompositeElev);

            writer.WriteShort(CellCCV);
            writer.WriteShort(CellTargetCCV);
            writer.WriteShort(CellPreviousMeasuredCCV);
            writer.WriteShort(CellPreviousMeasuredTargetCCV);

            writer.WriteFloat(CellCCVElev);

            writer.WriteShort(CellMDP);
            writer.WriteShort(CellTargetMDP);
            writer.WriteFloat(CellMDPElev);

            writer.WriteByte(CellCCA);
            writer.WriteShort(CellTargetCCA);
            writer.WriteFloat(CellCCAElev);

            writer.WriteFloat(CellTopLayerThickness);
            writer.WriteBoolean(IncludesProductionData);

            writer.WriteInt(TopLayerPassCount);
            writer.WriteInt(TopLayerPassCountTargetRangeMin);
            writer.WriteInt(TopLayerPassCountTargetRangeMax);

            writer.WriteInt(CellMaxSpeed);
            writer.WriteInt(CellMinSpeed);

            Passes.ToBinary(writer);

            writer.WriteBooleanArray(FilteredPassFlags);
            writer.WriteInt(FilteredPassCount);
            writer.WriteInt(FilteredHalfPassCount);
            writer.WriteInt((int)AttributeExistenceFlags);

            writer.WriteInt(CellMaterialTemperature);
            writer.WriteInt(CellMaterialTemperatureWarnMin);
            writer.WriteInt(CellMaterialTemperatureWarnMax);

            writer.WriteFloat(CellMaterialTemperatureElev);
        }