xcom2charpool
Version:
Library for reading, manipulating, and managing XCOM 2 character pool binary files, supporting both browser and Node.js environments.
24 lines (23 loc) • 618 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.StrProperty = void 0;
const BaseCodec_1 = require("../BaseCodec");
/**
* Codec for UE StrProperty values.
*/
class StrProperty extends BaseCodec_1.BaseCodec {
constructor() {
super(...arguments);
this.type = 'StrProperty';
}
read(reader, length, ctx) {
return this.readSized(reader, length, ctx, (p) => p.string());
}
write(writer, value) {
writer.string(value);
}
isSupported(value) {
return typeof value === 'string';
}
}
exports.StrProperty = StrProperty;