import { BinaryClassUpgrader } from "../../../storage/binary/BinaryClassUpgrader.js";

export class ClingToTerrainSerializationUpgrader_0_1 extends BinaryClassUpgrader {


        __startVersion = 0;
        __targetVersion = 1;


    /**
     *
     * @param {BinaryBuffer} source
     * @param {BinaryBuffer} target
     */
    upgrade(source, target) {
        // Read the old data
        const normalAlign = source.readUint8();

        // Write the old data to the new format
        target.writeUint8(normalAlign);
        // Write a default value for the new field (rotationSpeed)
        target.writeFloat32(3); // Use the default value from the ClingToTerrain class
    }
}