Skip to content

Commit

Permalink
add chat, split functions
Browse files Browse the repository at this point in the history
  • Loading branch information
h3902340 committed Dec 1, 2023
1 parent 91183dc commit 1df983e
Show file tree
Hide file tree
Showing 18 changed files with 1,048 additions and 391 deletions.
17 changes: 15 additions & 2 deletions dist/index.d.mts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ interface Replay {
exeVersion: number;
setting: GameSetting;
players: Player[];
teams: Team[];
}
interface GameSetting {
allowCheats: boolean;
Expand Down Expand Up @@ -40,7 +41,12 @@ interface Player {
homecityName: string;
slotId: number;
playerName: string;
intialDecks: Deck[];
initialDecks: Deck[];
}
interface Team {
id: number;
name: string;
members: number[];
}
interface Deck {
deckName: string;
Expand All @@ -50,12 +56,19 @@ interface Deck {
cardCount: number;
techIds: number[];
}
interface Message {
fromId: number;
toId: number;
message: string;
time: number;
}

/**
* Parse the entire replay to get a Replay object.
* @param fileArrayBuffer provide the array buffer of age3Yrec file
* @returns return a replay with game infos
*/
declare function parseReplay(fileArrayBuffer: ArrayBuffer): Replay;
declare function parseChat(fileArrayBuffer: ArrayBuffer): Message[];

export { parseReplay };
export { parseChat, parseReplay };
17 changes: 15 additions & 2 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ interface Replay {
exeVersion: number;
setting: GameSetting;
players: Player[];
teams: Team[];
}
interface GameSetting {
allowCheats: boolean;
Expand Down Expand Up @@ -40,7 +41,12 @@ interface Player {
homecityName: string;
slotId: number;
playerName: string;
intialDecks: Deck[];
initialDecks: Deck[];
}
interface Team {
id: number;
name: string;
members: number[];
}
interface Deck {
deckName: string;
Expand All @@ -50,12 +56,19 @@ interface Deck {
cardCount: number;
techIds: number[];
}
interface Message {
fromId: number;
toId: number;
message: string;
time: number;
}

/**
* Parse the entire replay to get a Replay object.
* @param fileArrayBuffer provide the array buffer of age3Yrec file
* @returns return a replay with game infos
*/
declare function parseReplay(fileArrayBuffer: ArrayBuffer): Replay;
declare function parseChat(fileArrayBuffer: ArrayBuffer): Message[];

export { parseReplay };
export { parseChat, parseReplay };
Loading

0 comments on commit 1df983e

Please sign in to comment.