import { BinaryClassSerializationAdapter } from "../../../ecs/storage/binary/BinaryClassSerializationAdapter.js";
import { SucceedingBehavior } from "./SucceedingBehavior.js";

export class SucceedingBehaviorSerializationAdapter extends BinaryClassSerializationAdapter {

    klass = SucceedingBehavior;
    version = 0;

    /**
     *
     * @param {BinaryBuffer} buffer
     * @param {SucceedingBehavior} value
     */
    serialize(buffer, value) {
        buffer.writeUintVar(value.delayTicks);
    }

    /**
     *
     * @param {BinaryBuffer} buffer
     * @param {SucceedingBehavior} value
     */
    deserialize(buffer, value) {
        value.delayTicks = buffer.readUintVar();
    }
}
