xcom2charpool
Version:
Library for reading, manipulating, and managing XCOM 2 character pool binary files, supporting both browser and Node.js environments.
29 lines (28 loc) • 936 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.NameProperty = void 0;
/**
* Represented as a String followed by a UInt32 that is
* usually (but not always) 0. As the function of this UInt32 is unknown for
* the moment, we just represent the value of if as plain number
*
* Неизвестное значение как-то связано с вариантами (версиями?) предметов
*/
class NameProperty {
constructor(value, unk) {
this.value = value;
this.unk = unk;
}
static from(reader, name, size) {
const value = reader.string();
const unk = reader.uint32();
return new this(value, unk);
}
static to(target, value) {
// Write the string value
target.string(value.value);
// Write the uint32 'unk' value
target.uint32(value.unk);
}
}
exports.NameProperty = NameProperty;