Created
July 18, 2023 09:11
-
-
Save ciaoben/071b8f658598c7ec2dabe49293250f76 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const category_mapping = { | |
// defence | |
'saves-insidebox': { | |
category: 2, | |
points: 3, | |
}, | |
clearances: { | |
category: 2, | |
points: 0.5, | |
}, | |
saves: { | |
category: 2, | |
points: 2, | |
}, | |
interceptions: { | |
category: 2, | |
points: 2, | |
}, | |
'blocked-shots': { | |
category: 2, | |
points: 1.5, | |
}, | |
'shots-blocked': { | |
category: 2, | |
points: 1.5, | |
}, | |
'through-balls-won': { | |
category: 2, | |
points: 2, | |
}, | |
'through-balls-won': { | |
category: 2, | |
points: 2, | |
}, | |
'penalties-committed': { | |
category: 2, | |
points: -8, | |
role: { | |
defender: -10, | |
}, | |
}, | |
'error-lead-to-goal': { | |
category: 2, | |
points: -5, | |
}, | |
punches: { | |
category: 2, | |
points: 1, | |
}, | |
'clean-sheet': { | |
category: 2, | |
points: 5, | |
role: { | |
goalkeeper: 15, | |
defender: 10, | |
}, | |
}, | |
// play_making | |
'accurate-passes': { | |
category: 5, | |
points: 0.1, | |
}, | |
'accurate-passes-percentage': { | |
category: 5, | |
points: 0, // TODO: handle separately | |
}, | |
'long-balls': { | |
category: 5, | |
points: 1, | |
}, | |
'wrong-passes': { | |
category: 5, | |
points: -0.1, // TODO: calculate using "passes -accurate-passes" | |
}, | |
// passes: { | |
// category: 5, | |
// points: 0 | |
// }, | |
'through-balls': { | |
category: 5, | |
points: 3, | |
}, | |
'key-passes': { | |
category: 5, | |
points: 3, | |
}, | |
// general | |
'minutes-played': { | |
category: 1, | |
points: 0, | |
}, | |
rating: { | |
category: 1, | |
points: 0, // TODO: handle separately | |
}, | |
assists: { | |
category: 1, | |
points: 8, | |
}, | |
goals: { | |
category: 1, | |
points: 20, | |
role: { | |
defender: 22, | |
goalkeeper: 40, | |
}, | |
}, | |
'goalkeeper-goals-conceded': { | |
category: 1, | |
points: -3, | |
}, | |
'goals-conceded': { | |
category: 1, | |
points: -0.5, | |
role: { | |
defender: -1, | |
}, | |
}, | |
'penalties-scored': { | |
category: 1, | |
points: 0, | |
}, | |
yellowcards: { | |
category: 1, | |
points: -5, | |
}, | |
'yellowred-cards': { | |
category: 1, | |
points: -10, // TODO: verify that it does not give redcards | |
}, | |
redcards: { | |
category: 1, | |
points: -10, | |
}, | |
'penalties-saved': { | |
category: 1, | |
points: 30, | |
}, | |
'penalties-missed': { | |
category: 1, | |
points: -20, | |
}, | |
positive_impact: { | |
category: 1, | |
points: 10, | |
}, | |
negative_impact: { | |
category: 1, | |
points: -5, | |
}, | |
// grit | |
'long-balls-won': { | |
category: 4, | |
points: 1, | |
}, | |
tackles: { | |
category: 4, | |
points: 2, | |
role: { | |
defender: 3, | |
}, | |
}, | |
'total-duels': { | |
category: 4, | |
points: 1, | |
}, | |
'duels-lost': { | |
category: 4, | |
points: -0.5, | |
}, | |
'duels-won': { | |
category: 4, | |
points: 0.5, | |
}, | |
'aeriels-won': { | |
category: 4, | |
points: 0.5, | |
}, | |
'dribbled-past': { | |
category: 4, | |
points: -1, | |
role: { | |
defender: -2, | |
}, | |
}, | |
'fouls-drawn': { | |
category: 4, | |
points: 1, | |
}, | |
dispossessed: { | |
category: 4, | |
points: -1, | |
}, | |
'own-goals': { | |
category: 1, | |
points: -15, | |
}, | |
fouls: { | |
category: 4, | |
points: -1, | |
}, | |
'shots-total': { | |
category: 3, | |
points: 1.5, | |
}, | |
'dribble-attempts': { | |
category: 3, | |
points: 1, | |
}, | |
'successful-dribbles': { | |
category: 3, | |
points: 2, | |
}, | |
'shots-on-target': { | |
category: 3, | |
points: 3, | |
}, | |
'accurate-crosses': { | |
category: 3, | |
points: 3, | |
}, | |
'total-crosses': { | |
category: 3, | |
points: 0.1, | |
}, | |
offsides: { | |
category: 3, | |
points: -2, | |
}, | |
'big-chances-created': { | |
category: 3, | |
points: 3, | |
}, | |
'hit-woodwork': { | |
category: 3, | |
points: 4, | |
}, | |
'big-chances-missed': { | |
category: 3, | |
points: -8, | |
}, | |
'shots-off-target': { | |
category: 3, | |
points: 0, | |
}, | |
'penalties-won': { | |
category: 3, | |
points: 4, | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment