raylib-wasm-transpiler/server/components/Entity.js

204 lines
5.1 KiB
JavaScript
Raw Normal View History

class Entity {
get Name() {
return this._decoder.decode(new Uint8Array(this._ptr.slice(0, 24)));
}
set Name(v) {
this._data.set(this._encoder.encode(v), 0);
}
get Strength() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(24, true);
}
set Strength(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(24, v, true);
}
get Endurance() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(25, true);
}
set Endurance(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(25, v, true);
}
get Intelligence() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(26, true);
}
set Intelligence(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(26, v, true);
}
get Wisdom() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(27, true);
}
set Wisdom(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(27, v, true);
}
get Charisma() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(28, true);
}
set Charisma(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(28, v, true);
}
get Faith() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(29, true);
}
set Faith(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(29, v, true);
}
get Artisan() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(30, true);
}
set Artisan(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(30, v, true);
}
get Metalworking() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(31, true);
}
set Metalworking(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(31, v, true);
}
get Alchemy() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(32, true);
}
set Alchemy(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(32, v, true);
}
get Engineering() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(33, true);
}
set Engineering(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(33, v, true);
}
get Culinary() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(34, true);
}
set Culinary(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(34, v, true);
}
get Ranged() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(35, true);
}
set Ranged(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(35, v, true);
}
get Melee() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(36, true);
}
set Melee(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(36, v, true);
}
get Acrobatics() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(37, true);
}
set Acrobatics(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(37, v, true);
}
get Prestidigitation() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(38, true);
}
set Prestidigitation(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(38, v, true);
}
get Language() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(39, true);
}
set Language(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(39, v, true);
}
get Medicine() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(40, true);
}
set Medicine(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(40, v, true);
}
2024-05-27 21:05:31 -04:00
get Thaumatology() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(41, true);
}
2024-05-27 21:05:31 -04:00
set Thaumatology(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(41, v, true);
}
get Theology() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(42, true);
}
set Theology(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(42, v, true);
}
get Fishing() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(43, true);
}
set Fishing(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(43, v, true);
}
get Mining() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(44, true);
}
set Mining(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(44, v, true);
}
get Survival() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(45, true);
}
set Survival(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(45, v, true);
}
get Gardening() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(46, true);
}
set Gardening(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(46, v, true);
}
get History() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(47, true);
}
set History(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(47, v, true);
}
get Perception() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(48, true);
}
set Perception(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(48, v, true);
}
get Luck() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(49, true);
}
set Luck(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(49, v, true);
}
get Stealth() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(50, true);
}
set Stealth(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(50, v, true);
}
get Attractiveness() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(51, true);
}
set Attractiveness(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(51, v, true);
}
get Affluence() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(52, true);
}
set Affluence(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(52, v, true);
}
get Notoriety() {
2024-05-27 20:19:37 -04:00
return this._data.getUint8(53, true);
}
set Notoriety(v) {
2024-05-27 20:19:37 -04:00
return this._data.setUint8(53, v, true);
}
get bytes() {
return new Uint8Array(this._ptr);
}
constructor(init = {}, ptr = undefined) {
2024-05-27 20:19:37 -04:00
this._size = 54;
this._ptr = ptr.buffer || new ArrayBuffer(this._size);
this._data = new DataView(this._ptr);
this._encoder = new TextEncoder();
this._decoder = new TextDecoder();
for (const key of Object.keys(init)) {
this[key] = init[key];
}
}
2024-05-27 19:26:24 -04:00
}
export default Entity