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

262 lines
7.7 KiB
JavaScript
Raw Permalink Normal View History

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