UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

27 lines (22 loc) 693 B
import { BinaryClassSerializationAdapter } from "../storage/binary/BinaryClassSerializationAdapter.js"; import { TooltipComponent } from "./TooltipComponent.js"; export class TooltipComponentSerializationAdapter extends BinaryClassSerializationAdapter { klass = TooltipComponent; version = 0; /** * * @param {BinaryBuffer} buffer * @param {TooltipComponent} value */ serialize(buffer, value) { buffer.writeUTF8String(value.key); } /** * * @param {BinaryBuffer} buffer * @param {TooltipComponent} value */ deserialize(buffer, value) { value.key = buffer.readUTF8String(); } }