Skip to content
Snippets Groups Projects
Commit 15ddb734 authored by Arkerthan's avatar Arkerthan
Browse files

static typing for limbs

parent ce63cb0b
No related branches found
No related tags found
No related merge requests found
declare namespace FC {
type prostheticID = "interfaceP1" | "interfaceP2" | "basicL" | "sexL" | "beautyL" | "combatL" | "cyberneticL" |
"ocular" | "cochlear" | "electrolarynx" | "interfaceTail" | "modT" | "sexT" | "combatT" | "erectile";
}
/**
* do not change order, order = display order
*
* @type {string[]}
* @type {FC.prostheticID[]}
*/
App.Data.prostheticIDs =
["interfaceP1", "interfaceP2", "basicL", "sexL", "beautyL", "combatL", "cyberneticL", "ocular", "cochlear",
......@@ -20,7 +20,7 @@ App.Data.prostheticIDs =
*/
/**
* @type {Object<string, prosthetics>}
* @type {Object<FC.prostheticID, prosthetics>}
*/
App.Data.prosthetics = {
interfaceP1: {
......@@ -161,21 +161,16 @@ App.Data.modTails = new Map([
]);
/**
* TODO expand with beauty stats and similar
*
* @type {Map<number, {minimumInterface: number, prostheticKey: string, short: string}>}
* @typedef {object} prostheticLimb
* @property {string} short
* @property {FC.prostheticID} prostheticKey
* @property {number} minimumInterface
*/
App.Data.limbs = new Map([
/* TODO think about how to include these
[0, {
short: "None",
isProsthetic: false,
}],
[0, {
short: "Human",
isProsthetic: false,
}],
*/
/**
* @type {Map<number, prostheticLimb>}
*/
App.Data.prostheticLimbs = new Map([
[2, {
short: "basic prosthetic",
prostheticKey: "basicL",
......
......@@ -39,6 +39,9 @@ App.UI.prostheticsConfig = function(slave) {
return fragment;
/**
* @returns {DocumentFragment}
*/
function eyes() {
const f = document.createDocumentFragment();
......@@ -144,6 +147,9 @@ App.UI.prostheticsConfig = function(slave) {
return f;
}
/**
* @returns {DocumentFragment}
*/
function ears() {
const f = document.createDocumentFragment();
if (slave.earImplant === 1) {
......@@ -185,6 +191,9 @@ App.UI.prostheticsConfig = function(slave) {
return f;
}
/**
* @returns {DocumentFragment}
*/
function voice() {
const f = document.createDocumentFragment();
......@@ -234,6 +243,9 @@ App.UI.prostheticsConfig = function(slave) {
return f;
}
/**
* @returns {DocumentFragment}
*/
function limbs() {
const f = document.createDocumentFragment();
App.UI.DOM.appendNewElement("h2", f, "Limbs");
......@@ -243,6 +255,9 @@ App.UI.prostheticsConfig = function(slave) {
return f;
}
/**
* @returns {DocumentFragment}
*/
function tail() {
const f = document.createDocumentFragment();
App.UI.DOM.appendNewElement("h2", f, "Tail");
......@@ -315,6 +330,9 @@ App.UI.prostheticsConfig = function(slave) {
return f;
}
/**
* @returns {DocumentFragment}
*/
function buyScreen() {
const f = document.createDocumentFragment();
App.UI.DOM.appendNewElement("h2", f, "Prosthetics");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment