Small bugfix

This commit is contained in:
Dominic Ferrando
2025-10-15 13:43:08 -04:00
parent 02cc87d6ba
commit 44de0d9f64
3 changed files with 14 additions and 18 deletions
+13 -8
View File
@@ -9,6 +9,7 @@
Attribute,
Gender,
lbToKg,
range,
type ActivityPerformance,
type Player,
} from "$lib/services/calculator/util";
@@ -47,13 +48,15 @@
localStorage.setItem("calculations", JSON.stringify(calculations));
});
$inspect(calculations[0]);
const createCalculation = function (name: string) {
return {
player: {
name: name,
metrics: {
age: 18,
weight: 180,
weight: lbToKg(180),
gender: Gender.Male,
},
},
@@ -240,14 +243,16 @@
<label class="form-control">
<span class="label mb-1 text-xs">Weight</span>
<input
class="input input-bordered input-sm w-full"
type="number"
min="1"
max="500"
step="1"
<select
class="select select-bordered select-sm w-full"
bind:value={calculation.player.metrics.weight}
/>
>
{#each range(400) as weight}
<option value={String(lbToKg(weight))}
>{weight}</option
>
{/each}
</select>
</label>
</div>
</fieldset>
+1 -6
View File
@@ -53,14 +53,9 @@ export type ActivityStandards = Record<Activity, {
}>;
export class LevelCalculator {
cfg: Required<LevelCalculatorConfig>;
standards: Standards;
public constructor(standards: Standards, cfg: LevelCalculatorConfig = {}) {
this.cfg = {
expandIters: cfg.expandIters ?? 5,
compressTo: cfg.compressTo ?? 100
}
public constructor(standards: Standards) {
this.standards = standards;
}