refactoring in progress checkpoint reached

goal: remove class by breaking it up into smaller functions
This commit is contained in:
2023-09-23 15:29:41 +02:00
parent 2f4cde091b
commit 960a5a7d92
10 changed files with 220 additions and 33 deletions
+10 -1
View File
@@ -53,7 +53,16 @@ export function RollAllAbilities(setValue: (newValue: KarakterTulajdonsagok) =>
export const Modifier = (val : number) => Math.floor(val / 3) - 3
/* eslint-disable */ /* tslint:disable */
export function TulajdonsagModosito(tulajdonsagok: KarakterTulajdonsagok): KarakterTulajdonsagok {
let response: KarakterTulajdonsagok = { ...tulajdonsagok }
const keys = Object.keys(tulajdonsagok) as (keyof KarakterTulajdonsagok)[]
for (const key of keys) {
response[key] = Modifier(tulajdonsagok[key])
}
return response
}
// noinspection OverlyComplexFunctionJS,FunctionTooLongJS
function tulajdonsagModositokPerFaj(tul: Tulajdonsag, faj: Faj) : number {
switch (faj) {
case Faj.Birodalmi: switch (tul) {