UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

21 lines (15 loc) 776 B
import { BinaryBuffer } from "../../../../core/binary/BinaryBuffer.js"; import { BinaryClassUpgrader } from "../../../ecs/storage/binary/BinaryClassUpgrader.js"; export class PathFollowerSerializationUpgrader_2_3 extends BinaryClassUpgrader { __startVersion = 2; __targetVersion = 3; upgrade(source, target) { const flags = source.readUint8(); target.writeUint16(flags); BinaryBuffer.copyFloat32(source, target); // speed BinaryBuffer.copyFloat32(source, target); // rotation speed source.readUint8(); // rotation Alignment - ignore (now in flags) source.readUint8(); // position Writing - ignore (now in flags) BinaryBuffer.copyFloat32(source, target); // max move distance } }