Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
h3902340 committed Nov 30, 2023
1 parent a40994b commit 06ddda3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"test": "jest"
},
"name": "@canyougiant/aoe3de-replay-parser",
"version": "1.1.0",
"version": "1.1.1",
"description": "Parsing Age3Yrec file of AOE3DE",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/dataStructures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export interface Player {
homecityName: string,
slotId: number,
playerName: string,
intialDecks: Deck[],
initialDecks: Deck[],
}

export interface Deck {
Expand Down
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ export function parseReplay(fileArrayBuffer: ArrayBuffer): Replay {
homecityName: dictionary[`gameplayer${i}homecityname`],
slotId: dictionary[`gameplayer${i}id`],
playerName: dictionary[`gameplayer${i}name`],
intialDecks: [],
initialDecks: [],
}
players.push(player);
}

// intial decks
// initial decks
players.sort((a, b) => a.slotId - b.slotId);
let deckIndex: number = 0;
let allDecks = searchAllDecks();
for (let i = 0; i < players.length; i++) {
let intialDecks: Deck[] = [];
let initialDecks: Deck[] = [];
let previousDeckId: number = allDecks[0].deckId;
while (deckIndex < allDecks.length) {
if (allDecks[deckIndex].deckId < previousDeckId) {
Expand All @@ -78,7 +78,7 @@ export function parseReplay(fileArrayBuffer: ArrayBuffer): Replay {
if (allDecks[deckIndex].deckName == '*') {
break;
}
intialDecks.push(allDecks[deckIndex]);
initialDecks.push(allDecks[deckIndex]);
previousDeckId = allDecks[deckIndex].deckId;
deckIndex++;
}
Expand All @@ -88,7 +88,7 @@ export function parseReplay(fileArrayBuffer: ArrayBuffer): Replay {
}
deckIndex++;
}
players[i].intialDecks = intialDecks;
players[i].initialDecks = initialDecks;
}

let replay: Replay = {
Expand Down
2 changes: 1 addition & 1 deletion tests/parse1.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ test('adds two numbers correctly', () => {
console.log(replay);
expect(replay).toBeDefined();
for (let i = 0; i < replay.players.length; i++) {
expect(replay.players[i].intialDecks.length).toBeGreaterThan(0);
expect(replay.players[i].initialDecks.length).toBeGreaterThan(0);
}
});
2 changes: 1 addition & 1 deletion tests/parse2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ test('adds two numbers correctly', () => {
console.log(replay);
expect(replay).toBeDefined();
for (let i = 0; i < replay.players.length; i++) {
expect(replay.players[i].intialDecks.length).toBeGreaterThan(0);
expect(replay.players[i].initialDecks.length).toBeGreaterThan(0);
}
});

0 comments on commit 06ddda3

Please sign in to comment.