Forráskód Böngészése

production: "ship to" → "exports"

raylu 1 hónapja
szülő
commit
22cca64a2e
1 módosított fájl, 13 hozzáadás és 13 törlés
  1. 13 13
      ts/production.ts

+ 13 - 13
ts/production.ts

@@ -281,7 +281,7 @@ function renderProduction(expertiseGroups: Record<string, string[]>, production:
 	let totalConsumablesCost = 0;
 	for (const [expertise, productionBuildings] of Object.entries(expertiseGroups)) {
 		section.append(element('h3', {textContent: expertise.toLocaleLowerCase()}));
-		const shipTo: Record<string, Record<string, number>> = {};
+		const exportTo: Record<string, Record<string, number>> = {};
 		for (const building of productionBuildings) {
 			const buildingRow = element('div', {className: 'building-row'});
 			const mats = Object.entries(production[building]);
@@ -289,7 +289,7 @@ function renderProduction(expertiseGroups: Record<string, string[]>, production:
 			for (const [mat, amount] of mats) {
 				buildingRow.append(document.createTextNode(' '));
 				buildingRow.append(renderProductionBuildingMat(expertise, mat, amount, storage,
-						matInputs, matConsumers, shipTo));
+						matInputs, matConsumers, exportTo));
 
 				const recipe = recipes[mat];
 				const outputPerRun = recipe.outputs.find((o) => o.material_ticker === mat)!.material_amount;
@@ -303,14 +303,14 @@ function renderProduction(expertiseGroups: Record<string, string[]>, production:
 			section.append(buildingRow);
 		}
 
-		const shipToDetails = element('details');
-		shipToDetails.append(element('summary', {textContent: 'ship to'}));
-		for (const [expertise, mats] of Object.entries(shipTo)) {
-			const shipToRow = element('div', {textContent: expertise.toLocaleLowerCase() + ': '});
-			shipToRow.textContent += Object.entries(mats).map(([mat, amount]) => `${amount}x${mat}`).join(' ');
-			shipToDetails.append(shipToRow);
+		const exportDetails = element('details');
+		exportDetails.append(element('summary', {textContent: 'exports'}));
+		for (const [expertise, mats] of Object.entries(exportTo)) {
+			const exportToRow = element('div', {textContent: expertise.toLocaleLowerCase() + ': '});
+			exportToRow.textContent += Object.entries(mats).map(([mat, amount]) => `${amount}x${mat}`).join(' ');
+			exportDetails.append(exportToRow);
 		}
-		section.append(shipToDetails);
+		section.append(exportDetails);
 	}
 
 	section.append(element('h4', {textContent: `total consumables cost: ${formatWhole(totalConsumablesCost)}/day,
@@ -321,7 +321,7 @@ function renderProduction(expertiseGroups: Record<string, string[]>, production:
 function renderProductionBuildingMat(expertise: string, mat: string, amount: number, storage: Record<string, number>,
 		matInputs: Record<string, {upstreamMat: string, amount: number}[]>,
 		matConsumers: Record<string, {downstreamMat: string, expertise: string, amount: number}[]>,
-		shipTo: Record<string, Record<string, number>>): HTMLElement {
+		exportTo: Record<string, Record<string, number>>): HTMLElement {
 	const inStorage = storage[mat] ?? 0;
 	const wrapper = element('span');
 
@@ -353,9 +353,9 @@ function renderProductionBuildingMat(expertise: string, mat: string, amount: num
 		for (const consumer of consumers) {
 			if (consumer.expertise == expertise) // we aren't shipping it anywhere
 				continue;
-			if (!shipTo[consumer.expertise])
-				shipTo[consumer.expertise] = {};
-			shipTo[consumer.expertise][mat] = (shipTo[consumer.expertise][mat] ?? 0) + consumer.amount;
+			if (!exportTo[consumer.expertise])
+				exportTo[consumer.expertise] = {};
+			exportTo[consumer.expertise][mat] = (exportTo[consumer.expertise][mat] ?? 0) + consumer.amount;
 		}
 	}
 	amountText.dataset.tooltip = tooltip;