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

export class WaitForEventBehaviorSerializationAdapter extends BinaryClassSerializationAdapter {

    klass = WaitForEventBehavior;
    version = 0;

    /**
     *
     * @param {BinaryBuffer} buffer
     * @param {WaitForEventBehavior} value
     */
    serialize(buffer, value) {
        buffer.writeUTF8String(value.event);
    }

    /**
     *
     * @param {BinaryBuffer} buffer
     * @param {WaitForEventBehavior} value
     */
    deserialize(buffer, value) {
        value.event = buffer.readUTF8String();
    }
}
