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

262 lines
7.7 KiB
JavaScript

/**
* @typedef {Object} Skills User skills
* @property {Uint8} u8 Crafting, visual arts, etc.
* @property {Uint8} u8 cooking, baking, brewing,
* @property {Uint8} u8 using guns/cannons, bows, etc.
* @property {Uint8} u8 using swords, hammers, pole-arms etc.
* @property {Uint8} u8 being able to contort, move, dodge, etc.
* @property {Uint8} u8 skullduggery, lock-picking, deceiving, slight of hand
* @property {Uint8} u8 creating and using contraptions, building houses
* @property {Uint8} u8 obvious, but in this you can also use automatic stuff
* @property {Uint8} u8 ability to read/write a specific language
* @property {Uint8} u8 healing hp, getting rid of diseases, etc.
* @property {Uint8} u8 Creating potions, creating alloys, creating chemicals, component based 'magic'
* @property {Uint8} u8 collecting fish
* @property {Uint8} u8 collecting ore
* @property {Uint8} u8 woodcutting, fire-making, hunting, collecting herbs, etc.
* @property {Uint8} u8 growing plants, herbs, etc.
* @property {Uint8} u8 will give more information when examining some objects
*/
class Skills {
/**
* Crafting, visual arts, etc.
* @return {Uint8} gets the value of Artisan
*/
get Artisan() {
return this._data.getUint8(0, true);
}
/**
* Crafting, visual arts, etc.
* @param {Uint8} sets the value of Artisan
*/
set Artisan(v) {
return this._data.setUint8(0, v, true);
}
/**
* cooking, baking, brewing,
* @return {Uint8} gets the value of Culinary
*/
get Culinary() {
return this._data.getUint8(1, true);
}
/**
* cooking, baking, brewing,
* @param {Uint8} sets the value of Culinary
*/
set Culinary(v) {
return this._data.setUint8(1, v, true);
}
/**
* using guns/cannons, bows, etc.
* @return {Uint8} gets the value of Ranged
*/
get Ranged() {
return this._data.getUint8(2, true);
}
/**
* using guns/cannons, bows, etc.
* @param {Uint8} sets the value of Ranged
*/
set Ranged(v) {
return this._data.setUint8(2, v, true);
}
/**
* using swords, hammers, pole-arms etc.
* @return {Uint8} gets the value of Melee
*/
get Melee() {
return this._data.getUint8(3, true);
}
/**
* using swords, hammers, pole-arms etc.
* @param {Uint8} sets the value of Melee
*/
set Melee(v) {
return this._data.setUint8(3, v, true);
}
/**
* being able to contort, move, dodge, etc.
* @return {Uint8} gets the value of Acrobatics
*/
get Acrobatics() {
return this._data.getUint8(4, true);
}
/**
* being able to contort, move, dodge, etc.
* @param {Uint8} sets the value of Acrobatics
*/
set Acrobatics(v) {
return this._data.setUint8(4, v, true);
}
/**
* skullduggery, lock-picking, deceiving, slight of hand
* @return {Uint8} gets the value of Prestidigitation
*/
get Prestidigitation() {
return this._data.getUint8(5, true);
}
/**
* skullduggery, lock-picking, deceiving, slight of hand
* @param {Uint8} sets the value of Prestidigitation
*/
set Prestidigitation(v) {
return this._data.setUint8(5, v, true);
}
/**
* creating and using contraptions, building houses
* @return {Uint8} gets the value of Engineering
*/
get Engineering() {
return this._data.getUint8(6, true);
}
/**
* creating and using contraptions, building houses
* @param {Uint8} sets the value of Engineering
*/
set Engineering(v) {
return this._data.setUint8(6, v, true);
}
/**
* obvious, but in this you can also use automatic stuff
* @return {Uint8} gets the value of Metalworking
*/
get Metalworking() {
return this._data.getUint8(7, true);
}
/**
* obvious, but in this you can also use automatic stuff
* @param {Uint8} sets the value of Metalworking
*/
set Metalworking(v) {
return this._data.setUint8(7, v, true);
}
/**
* ability to read/write a specific language
* @return {Uint8} gets the value of Language
*/
get Language() {
return this._data.getUint8(8, true);
}
/**
* ability to read/write a specific language
* @param {Uint8} sets the value of Language
*/
set Language(v) {
return this._data.setUint8(8, v, true);
}
/**
* healing hp, getting rid of diseases, etc.
* @return {Uint8} gets the value of Medicine
*/
get Medicine() {
return this._data.getUint8(9, true);
}
/**
* healing hp, getting rid of diseases, etc.
* @param {Uint8} sets the value of Medicine
*/
set Medicine(v) {
return this._data.setUint8(9, v, true);
}
/**
* Creating potions, creating alloys, creating chemicals, component based 'magic'
* @return {Uint8} gets the value of Alchemy
*/
get Alchemy() {
return this._data.getUint8(10, true);
}
/**
* Creating potions, creating alloys, creating chemicals, component based 'magic'
* @param {Uint8} sets the value of Alchemy
*/
set Alchemy(v) {
return this._data.setUint8(10, v, true);
}
/**
* collecting fish
* @return {Uint8} gets the value of Fishing
*/
get Fishing() {
return this._data.getUint8(11, true);
}
/**
* collecting fish
* @param {Uint8} sets the value of Fishing
*/
set Fishing(v) {
return this._data.setUint8(11, v, true);
}
/**
* collecting ore
* @return {Uint8} gets the value of Mining
*/
get Mining() {
return this._data.getUint8(12, true);
}
/**
* collecting ore
* @param {Uint8} sets the value of Mining
*/
set Mining(v) {
return this._data.setUint8(12, v, true);
}
/**
* woodcutting, fire-making, hunting, collecting herbs, etc.
* @return {Uint8} gets the value of Survival
*/
get Survival() {
return this._data.getUint8(13, true);
}
/**
* woodcutting, fire-making, hunting, collecting herbs, etc.
* @param {Uint8} sets the value of Survival
*/
set Survival(v) {
return this._data.setUint8(13, v, true);
}
/**
* growing plants, herbs, etc.
* @return {Uint8} gets the value of Gardening
*/
get Gardening() {
return this._data.getUint8(14, true);
}
/**
* growing plants, herbs, etc.
* @param {Uint8} sets the value of Gardening
*/
set Gardening(v) {
return this._data.setUint8(14, v, true);
}
/**
* will give more information when examining some objects
* @return {Uint8} gets the value of History
*/
get History() {
return this._data.getUint8(15, true);
}
/**
* will give more information when examining some objects
* @param {Uint8} sets the value of History
*/
set History(v) {
return this._data.setUint8(15, v, true);
}
/**
* Constructs a new Skills
*
* @param {{Artisan: Uint8, Culinary: Uint8, Ranged: Uint8, Melee: Uint8, Acrobatics: Uint8, Prestidigitation: Uint8, Engineering: Uint8, Metalworking: Uint8, Language: Uint8, Medicine: Uint8, Alchemy: Uint8, Fishing: Uint8, Mining: Uint8, Survival: Uint8, Gardening: Uint8, History: Uint8, }} init The arguments to construct the object.
* @param {Uint8Array} ptr The pointer to the C struct.
*/
constructor(init = {}, ptr = undefined) {
this._size = 16;
this._ptr = ptr || new Uint8Array(this._size);
this._data = new DataView(this._ptr.buffer);
for (const key of Object.keys(init)) {
this[key] = init[key];
}
}
}
export default Skills