updated helmets.json
This commit is contained in:
parent
13c45f2b9b
commit
ade1c99b70
@ -36,9 +36,14 @@
|
||||
<hr>
|
||||
|
||||
<li>
|
||||
<label for="equip-load"><b>Max. Equip Load</b></label>
|
||||
<input style="max-width: 50px" class="stat" id="equip-load" type="number" onchange="update()"
|
||||
min=0 step=0.1 value="30">
|
||||
<label for="max-equip-load"><b>Max. Equip Load</b></label>
|
||||
<input style="max-width: 50px" class="stat" id="max-equip-load" type="number"
|
||||
onchange="update()" min=0 step=0.1 value=30>
|
||||
</li>
|
||||
<li>
|
||||
<label for="current-equip-load"><b>Current Equip Load</b></label>
|
||||
<input style="max-width: 50px" class="stat" id="current-equip-load" type="number"
|
||||
onchange="update()" min=0 step=0.1 value=0>
|
||||
</li>
|
||||
|
||||
<hr>
|
||||
@ -71,7 +76,14 @@
|
||||
<hr>
|
||||
|
||||
<li>
|
||||
<b>Sorting</b>
|
||||
<b>Sort by</b>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<div>
|
||||
<input type="radio" id="greatest-average" name="sorting-order" onclick="update()">
|
||||
<label for="greatest-average">Greatest Average Defense</label>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
@ -95,13 +107,6 @@
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<div>
|
||||
<input type="radio" id="greatest-average" name="sorting-order" onclick="update()">
|
||||
<label for="greatest-average">Greatest Weighted Average Defense</label>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<hr>
|
||||
|
||||
<li>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -15,25 +15,42 @@ const LEGGINGS = fetch("/data/armor.json")
|
||||
.then(data => data.leggings)
|
||||
.catch(error => console.log(error));
|
||||
|
||||
async function init() {
|
||||
let sortedHelmets;
|
||||
let sortedChestplates;
|
||||
let sortedGauntlets;
|
||||
let sortedLeggings;
|
||||
|
||||
const SortingMethod = {
|
||||
AVERAGE,
|
||||
PHYSICAL,
|
||||
ELEMENTAL,
|
||||
IMMUNITIES,
|
||||
};
|
||||
|
||||
async function init() {
|
||||
// precompute and sort list of armor pieces
|
||||
}
|
||||
|
||||
async function update() {
|
||||
let sorted = sortedCandidates();
|
||||
let sorted = sortedCombinations();
|
||||
}
|
||||
|
||||
function sortedCandidates() {
|
||||
// determine how to sort
|
||||
|
||||
// get most likely candidates
|
||||
let candidates = findCandidates();
|
||||
|
||||
// sort candidates
|
||||
|
||||
return candidates;
|
||||
function updateSortingMethod() {
|
||||
update();
|
||||
}
|
||||
|
||||
function findCandidates() {
|
||||
return [];
|
||||
function fitness(item, order) {
|
||||
// return fitness of item based on given order
|
||||
switch (order) {
|
||||
case SortingMethod.AVERAGE:
|
||||
return item.defenses.reduce((total, value) => total + value, 0) / item.defenses.length;
|
||||
case SortingMethod.PHYSICAL:
|
||||
break;
|
||||
case SortingMethod.ELEMENTAL:
|
||||
break;
|
||||
case SortingMethod.IMMUNITIES:
|
||||
break;
|
||||
default:
|
||||
console.log("error pls fix");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user