UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

28 lines (23 loc) 787 B
import { BinaryClassSerializationAdapter } from "../../../ecs/storage/binary/BinaryClassSerializationAdapter.js"; import { AnimationRule } from "./AnimationRule.js"; import AnimationController from "./AnimationController.js"; export class AnimationControllerSerializationAdapter extends BinaryClassSerializationAdapter { klass = AnimationController; version = 0; /** * * @param {BinaryBuffer} buffer * @param {AnimationController} value */ serialize(buffer, value) { value.rules.toBinaryBuffer(buffer); } /** * * @param {BinaryBuffer} buffer * @param {AnimationController} value */ deserialize(buffer, value) { value.rules.fromBinaryBuffer(buffer, AnimationRule); } }