Skip to content

Commit

Permalink
Fixed more Typescript errors
Browse files Browse the repository at this point in the history
 Changes to be committed:
	modified:   ui/core/components/suggest_gems_action.ts
	modified:   ui/core/proto_utils/gear.ts
  • Loading branch information
NerdEgghead committed Dec 6, 2023
1 parent 714640d commit 55ba989
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions ui/core/components/suggest_gems_action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ abstract class GemOptimizer {
this.sim = simUI.sim;

// Initialize empty arrays of gem priorities for each socket color
this.gemPriorityByColor = {};
this.gemPriorityByColor = {} as Record<GemColor, Array<GemCapsData>>;

for (var gemColor of GemOptimizer.allGemColors) {
this.gemPriorityByColor[gemColor] = new Array<GemCapsData>();
Expand Down Expand Up @@ -206,7 +206,7 @@ abstract class GemOptimizer {
const gemData = this.jcUpgradePriority[gemIdx];
const baseGem = this.sim.db.lookupGem(gemData.gemId);

if (!updatedGear.getAllGems(this.isBlacksmithing).includes(baseGem)) {
if (!updatedGear.getAllGems(this.isBlacksmithing).includes(baseGem!)) {
gemIdx += 1;
continue;
}
Expand Down Expand Up @@ -274,11 +274,11 @@ abstract class GemOptimizer {
return await this.fillGemsToCaps(updatedGear, socketList, gemCaps, numPasses + 1, nextIdx);
}

abstract activateMetaGem(Gear): Gear;
abstract activateMetaGem(gear: Gear): Gear;

abstract updateGemPriority(Gear, Stats): void;
abstract updateGemPriority(ungemmedGear: Gear, passiveStats: Stats): void;

abstract allowGemInSocket(GemColor, GemColor, ItemSlot, EquippedItem): boolean;
abstract allowGemInSocket(gemColor: GemColor, socketColor: GemColor, itemSlot: ItemSlot, item: EquippedItem): boolean;
}

export class PhysicalDPSGemOptimizer extends GemOptimizer {
Expand All @@ -290,10 +290,10 @@ export class PhysicalDPSGemOptimizer extends GemOptimizer {
useExpGems: boolean;
useAgiGems: boolean;
useStrGems: boolean;
arpTarget: number;
passiveArp: number;
arpStackDetected: boolean;
tearSlot: ItemSlot | null;
arpTarget!: number;
passiveArp!: number;
arpStackDetected!: boolean;
tearSlot!: ItemSlot | null;

constructor(simUI: IndividualSimUI<any>, useArpGems: boolean, useExpGems: boolean, useAgiGems: boolean, useStrGems: boolean) {
super(simUI);
Expand Down
2 changes: 1 addition & 1 deletion ui/core/proto_utils/gear.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export class Gear extends BaseGear {
return this;
}

withSingleGemSubstitution(oldGem: Gem, newGem: Gem, isBlacksmithing: boolean): Gear {
withSingleGemSubstitution(oldGem: Gem | null, newGem: Gem | null, isBlacksmithing: boolean): Gear {
for (var slot of this.getItemSlots()) {
const item = this.getEquippedItem(slot);

Expand Down

0 comments on commit 55ba989

Please sign in to comment.