Skip to content

Commit

Permalink
Merge pull request #300 from Lukasdotcom/update-types-for-world-cup
Browse files Browse the repository at this point in the history
Updates the types for the world cup 2022
  • Loading branch information
Lukasdotcom authored Nov 20, 2022
2 parents ee3a355 + 6d6f2ff commit 1d69248
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
4 changes: 2 additions & 2 deletions scripts/data/WorldCup2022.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ export default async function Main(): Promise<dataGetter> {
value: e.cost,
position: ["", "gk", "def", "mid", "att"][e.position] as position,
forecast,
total_points: e.stats.totalPoints ? e.stats.totalPoints : 0,
average_points: e.stats.avgPoints ? e.stats.avgPoints : 0,
total_points: e.stats.totalPoints,
average_points: e.stats.avgPoints,
last_match: 0,
locked: e.locked === 1,
exists: e.status !== "eliminated",
Expand Down
24 changes: 22 additions & 2 deletions types/data/WorldCup2022.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,31 @@ export interface Player {
preferredName: string;
squadId: number;
cost: number;
stats: { [key: string]: number | null };
stats: Stats;
status: Status;
position: number;
locked: number;
matchDayPoints: { [key: string]: null };
matchDayPoints: { [key: string]: number | null };
}

export interface Stats {
totalPoints: number;
avgPoints: number;
gamesPlayed: number;
roundScores: { [key: string]: number | null } | null;
tournamentScores: { [key: string]: number | null } | null;
pickedBy: number;
goals: number;
assists: number;
redCard: number;
yellowCard: number;
ownGoals: number;
penaltySave: number;
penaltyMissed: number;
starting11: number;
substitutions: number;
cleanSheets: number;
goalsConceded: number;
}

export enum Status {
Expand Down

0 comments on commit 1d69248

Please sign in to comment.