返回提交历史
Modified
src/helpers/purchaseHelpers.ts
+14
-2
Modified
src/services/purchaseService.ts
+1
-15
XFEstudio/XFESpaceNinjaServer
chore: fix cyclic include for slotPurchaseNameToSlotName (#2618)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2618 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
79c5f7a6
代码差异
2 个文件
+15
-17
@@ -1,5 +1,17 @@
1
import { slotPurchaseNameToSlotName } from "@/src/services/purchaseService";
2
import { SlotPurchaseName } from "@/src/types/purchaseTypes";
1
import { SlotPurchase, SlotPurchaseName } from "@/src/types/purchaseTypes";
2
3
export const slotPurchaseNameToSlotName: SlotPurchase = {
4
SuitSlotItem: { name: "SuitBin", purchaseQuantity: 1 },
5
TwoSentinelSlotItem: { name: "SentinelBin", purchaseQuantity: 2 },
6
TwoWeaponSlotItem: { name: "WeaponBin", purchaseQuantity: 2 },
7
SpaceSuitSlotItem: { name: "SpaceSuitBin", purchaseQuantity: 1 },
8
TwoSpaceWeaponSlotItem: { name: "SpaceWeaponBin", purchaseQuantity: 2 },
9
MechSlotItem: { name: "MechBin", purchaseQuantity: 1 },
10
TwoOperatorWeaponSlotItem: { name: "OperatorAmpBin", purchaseQuantity: 2 },
11
RandomModSlotItem: { name: "RandomModBin", purchaseQuantity: 3 },
12
TwoCrewShipSalvageSlotItem: { name: "CrewShipSalvageBin", purchaseQuantity: 2 },
13
CrewMemberSlotItem: { name: "CrewMemberBin", purchaseQuantity: 1 }
14
};
3
15
4
16
export const isSlotPurchaseName = (slotPurchaseName: string): slotPurchaseName is SlotPurchaseName => {
5
17
return slotPurchaseName in slotPurchaseNameToSlotName;
@@ -1,4 +1,4 @@
1
import { parseSlotPurchaseName } from "@/src/helpers/purchaseHelpers";
1
import { parseSlotPurchaseName, slotPurchaseNameToSlotName } from "@/src/helpers/purchaseHelpers";
2
2
import { getSubstringFromKeyword } from "@/src/helpers/stringHelpers";
3
3
import {
4
4
addBooster,
@@ -14,7 +14,6 @@ import { IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes";
14
14
import {
15
15
IPurchaseRequest,
16
16
IPurchaseResponse,
17
SlotPurchase,
18
17
IInventoryChanges,
19
18
PurchaseSource,
20
19
IPurchaseParams
@@ -472,19 +471,6 @@ export const handleStoreItemAcquisition = async (
472
471
return purchaseResponse;
473
472
};
474
473
475
export const slotPurchaseNameToSlotName: SlotPurchase = {
476
SuitSlotItem: { name: "SuitBin", purchaseQuantity: 1 },
477
TwoSentinelSlotItem: { name: "SentinelBin", purchaseQuantity: 2 },
478
TwoWeaponSlotItem: { name: "WeaponBin", purchaseQuantity: 2 },
479
SpaceSuitSlotItem: { name: "SpaceSuitBin", purchaseQuantity: 1 },
480
TwoSpaceWeaponSlotItem: { name: "SpaceWeaponBin", purchaseQuantity: 2 },
481
MechSlotItem: { name: "MechBin", purchaseQuantity: 1 },
482
TwoOperatorWeaponSlotItem: { name: "OperatorAmpBin", purchaseQuantity: 2 },
483
RandomModSlotItem: { name: "RandomModBin", purchaseQuantity: 3 },
484
TwoCrewShipSalvageSlotItem: { name: "CrewShipSalvageBin", purchaseQuantity: 2 },
485
CrewMemberSlotItem: { name: "CrewMemberBin", purchaseQuantity: 1 }
486
};
487
488
474
// // extra = everything above the base +2 slots (depending on slot type)
489
475
// // new slot above base = extra + 1 and slots +1
490
476
// // new frame = slots -1