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

202 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() {
return this._data.getInt32(24, true);
}
set Strength(v) {
return this._data.setInt32(24, v, true);
}
get Endurance() {
return this._data.getInt32(28, true);
}
set Endurance(v) {
return this._data.setInt32(28, v, true);
}
get Intelligence() {
return this._data.getInt32(32, true);
}
set Intelligence(v) {
return this._data.setInt32(32, v, true);
}
get Wisdom() {
return this._data.getInt32(36, true);
}
set Wisdom(v) {
return this._data.setInt32(36, v, true);
}
get Charisma() {
return this._data.getInt32(40, true);
}
set Charisma(v) {
return this._data.setInt32(40, v, true);
}
get Faith() {
return this._data.getInt32(44, true);
}
set Faith(v) {
return this._data.setInt32(44, v, true);
}
get Artisan() {
return this._data.getInt32(48, true);
}
set Artisan(v) {
return this._data.setInt32(48, v, true);
}
get Metalworking() {
return this._data.getInt32(52, true);
}
set Metalworking(v) {
return this._data.setInt32(52, v, true);
}
get Alchemy() {
return this._data.getInt32(56, true);
}
set Alchemy(v) {
return this._data.setInt32(56, v, true);
}
get Engineering() {
return this._data.getInt32(60, true);
}
set Engineering(v) {
return this._data.setInt32(60, v, true);
}
get Culinary() {
return this._data.getInt32(64, true);
}
set Culinary(v) {
return this._data.setInt32(64, v, true);
}
get Ranged() {
return this._data.getInt32(68, true);
}
set Ranged(v) {
return this._data.setInt32(68, v, true);
}
get Melee() {
return this._data.getInt32(72, true);
}
set Melee(v) {
return this._data.setInt32(72, v, true);
}
get Acrobatics() {
return this._data.getInt32(76, true);
}
set Acrobatics(v) {
return this._data.setInt32(76, v, true);
}
get Prestidigitation() {
return this._data.getInt32(80, true);
}
set Prestidigitation(v) {
return this._data.setInt32(80, v, true);
}
get Language() {
return this._data.getInt32(84, true);
}
set Language(v) {
return this._data.setInt32(84, v, true);
}
get Medicine() {
return this._data.getInt32(88, true);
}
set Medicine(v) {
return this._data.setInt32(88, v, true);
}
get Thaumitology() {
return this._data.getInt32(92, true);
}
set Thaumitology(v) {
return this._data.setInt32(92, v, true);
}
get Theology() {
return this._data.getInt32(96, true);
}
set Theology(v) {
return this._data.setInt32(96, v, true);
}
get Fishing() {
return this._data.getInt32(100, true);
}
set Fishing(v) {
return this._data.setInt32(100, v, true);
}
get Mining() {
return this._data.getInt32(104, true);
}
set Mining(v) {
return this._data.setInt32(104, v, true);
}
get Survival() {
return this._data.getInt32(108, true);
}
set Survival(v) {
return this._data.setInt32(108, v, true);
}
get Gardening() {
return this._data.getInt32(112, true);
}
set Gardening(v) {
return this._data.setInt32(112, v, true);
}
get History() {
return this._data.getInt32(116, true);
}
set History(v) {
return this._data.setInt32(116, v, true);
}
get Perception() {
return this._data.getInt32(120, true);
}
set Perception(v) {
return this._data.setInt32(120, v, true);
}
get Luck() {
return this._data.getInt32(124, true);
}
set Luck(v) {
return this._data.setInt32(124, v, true);
}
get Stealth() {
return this._data.getInt32(128, true);
}
set Stealth(v) {
return this._data.setInt32(128, v, true);
}
get Attractiveness() {
return this._data.getInt32(132, true);
}
set Attractiveness(v) {
return this._data.setInt32(132, v, true);
}
get Affluence() {
return this._data.getInt32(136, true);
}
set Affluence(v) {
return this._data.setInt32(136, v, true);
}
get Notoriety() {
return this._data.getInt32(140, true);
}
set Notoriety(v) {
return this._data.setInt32(140, v, true);
}
get bytes() {
return new Uint8Array(this._ptr);
}
constructor(init = {}, ptr = undefined) {
this._size = 144;
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];
}
}
}