-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trade filter #358
base: master
Are you sure you want to change the base?
Trade filter #358
Changes from 10 commits
41db9b4
4fd158f
410d4ad
1c68118
7d0d029
aa77edb
15c68e6
d283adc
89ff148
3413cbf
8d0c94d
2e0ca69
03faf98
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,40 @@ | ||
import type { CompositeWeights, Conf, Div } from "./types"; | ||
import type { CompositeWeights, Conf, Div, Skill } from "./types"; | ||
import type { RatingKey } from "./types.basketball"; | ||
|
||
const SKILLS: Skill = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be better to instead add a "description" field to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I'll change it to that approach. We'll just have to call a mapping function to extract the skill labels/descriptions (iirc) when we want them. Couldn't decide which way to go with it between the two |
||
B: { | ||
label: "B", | ||
description: "Ball Handler", | ||
}, | ||
Ps: { | ||
label: "Ps", | ||
description: "Passer", | ||
}, | ||
Po: { | ||
label: "Po", | ||
description: "Post Scorer", | ||
}, | ||
"3": { | ||
label: "3", | ||
description: "Three Point Shooter", | ||
}, | ||
R: { | ||
label: "R", | ||
description: "Rebounder", | ||
}, | ||
Di: { | ||
label: "Di", | ||
description: "Interior Defender", | ||
}, | ||
Dp: { | ||
label: "Dp", | ||
description: "Perimeter Defender", | ||
}, | ||
A: { | ||
label: "A", | ||
description: "Athlete", | ||
}, | ||
}; | ||
const COMPOSITE_WEIGHTS: CompositeWeights<RatingKey> = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Very recently a "V" "Volume scorer" label was added to "scoring", looks like it got lost in a merge. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also just realized I seem to have caught you guys as hockey is being added. I'll go ahead and make sure those are included as well |
||
pace: { | ||
ratings: ["spd", "jmp", "dnk", "tp", "drb", "pss"], | ||
|
@@ -17,15 +51,15 @@ const COMPOSITE_WEIGHTS: CompositeWeights<RatingKey> = { | |
ratings: ["drb", "spd"], | ||
weights: [1, 1], | ||
skill: { | ||
label: "B", | ||
label: SKILLS.B.label, | ||
cutoff: 0.68, | ||
}, | ||
}, | ||
passing: { | ||
ratings: ["drb", "pss", "oiq"], | ||
weights: [0.4, 1, 0.5], | ||
skill: { | ||
label: "Ps", | ||
label: SKILLS.Ps.label, | ||
cutoff: 0.63, | ||
}, | ||
}, | ||
|
@@ -41,7 +75,7 @@ const COMPOSITE_WEIGHTS: CompositeWeights<RatingKey> = { | |
ratings: ["hgt", "stre", "spd", "ins", "oiq"], | ||
weights: [1, 0.6, 0.2, 1, 0.4], | ||
skill: { | ||
label: "Po", | ||
label: SKILLS.Po.label, | ||
cutoff: 0.61, | ||
}, | ||
}, | ||
|
@@ -53,7 +87,7 @@ const COMPOSITE_WEIGHTS: CompositeWeights<RatingKey> = { | |
ratings: ["oiq", "tp"], | ||
weights: [0.1, 1], | ||
skill: { | ||
label: "3", | ||
label: SKILLS["3"].label, | ||
cutoff: 0.59, | ||
}, | ||
}, | ||
|
@@ -64,7 +98,7 @@ const COMPOSITE_WEIGHTS: CompositeWeights<RatingKey> = { | |
ratings: ["hgt", "stre", "jmp", "reb", "oiq", "diq"], | ||
weights: [2, 0.1, 0.1, 2, 0.5, 0.5], | ||
skill: { | ||
label: "R", | ||
label: SKILLS.R.label, | ||
cutoff: 0.61, | ||
}, | ||
}, | ||
|
@@ -92,15 +126,15 @@ const COMPOSITE_WEIGHTS: CompositeWeights<RatingKey> = { | |
ratings: ["hgt", "stre", "spd", "jmp", "diq"], | ||
weights: [2.5, 1, 0.5, 0.5, 2], | ||
skill: { | ||
label: "Di", | ||
label: SKILLS.Di.label, | ||
cutoff: 0.57, | ||
}, | ||
}, | ||
defensePerimeter: { | ||
ratings: ["hgt", "stre", "spd", "jmp", "diq"], | ||
weights: [0.5, 0.5, 2, 0.5, 1], | ||
skill: { | ||
label: "Dp", | ||
label: SKILLS.Dp.label, | ||
cutoff: 0.61, | ||
}, | ||
}, | ||
|
@@ -112,7 +146,7 @@ const COMPOSITE_WEIGHTS: CompositeWeights<RatingKey> = { | |
ratings: ["stre", "spd", "jmp", "hgt"], | ||
weights: [1, 1, 1, 0.75], | ||
skill: { | ||
label: "A", | ||
label: SKILLS.A.label, | ||
cutoff: 0.63, | ||
}, | ||
}, | ||
|
@@ -496,6 +530,7 @@ const DEFAULT_DIVS: Div[] = [ | |
const DEFAULT_STADIUM_CAPACITY = 25000; | ||
|
||
export { | ||
SKILLS, | ||
AWARD_NAMES, | ||
DEFAULT_CONFS, | ||
DEFAULT_DIVS, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,93 @@ | ||
import type { CompositeWeights, Conf, Div } from "./types"; | ||
import type { CompositeWeights, Conf, Div, Skill } from "./types"; | ||
import type { Position, PrimaryPosition, RatingKey } from "./types.football"; | ||
|
||
const SKILLS: Skill = { | ||
Pa: { | ||
label: "Pa", | ||
description: "Accurate Passer", | ||
}, | ||
Pd: { | ||
label: "Pd", | ||
description: "Deep Passer", | ||
}, | ||
Ps: { | ||
label: "Ps", | ||
description: "Smart Passer", | ||
}, | ||
A: { | ||
label: "A", | ||
description: "Athletic", | ||
}, | ||
X: { | ||
label: "X", | ||
description: "Explosive Runner", | ||
}, | ||
H: { | ||
label: "H", | ||
description: "Hands", | ||
}, | ||
Bp: { | ||
label: "Bp", | ||
description: "Pass Blocker", | ||
}, | ||
Br: { | ||
label: "Br", | ||
description: "Run Blocker", | ||
}, | ||
PR: { | ||
label: "PR", | ||
description: "Pass Rusher", | ||
}, | ||
RS: { | ||
label: "RS", | ||
description: "Run Stopper", | ||
}, | ||
L: { | ||
label: "L", | ||
description: "Lockdown Coverage", | ||
}, | ||
}; | ||
const COMPOSITE_WEIGHTS: CompositeWeights<RatingKey> = { | ||
passingAccuracy: { | ||
ratings: ["tha", "hgt"], | ||
weights: [1, 0.2], | ||
skill: { | ||
label: "Pa", | ||
label: SKILLS.Pa.label, | ||
}, | ||
}, | ||
passingDeep: { | ||
ratings: ["thp", "tha", "hgt"], | ||
weights: [1, 0.1, 0.2], | ||
skill: { | ||
label: "Pd", | ||
label: SKILLS.Pd.label, | ||
}, | ||
}, | ||
passingVision: { | ||
ratings: ["thv", "hgt"], | ||
weights: [1, 0.5], | ||
skill: { | ||
label: "Ps", | ||
label: SKILLS.Ps.label, | ||
}, | ||
}, | ||
athleticism: { | ||
ratings: ["stre", "spd", "hgt"], | ||
weights: [1, 1, 0.2], | ||
skill: { | ||
label: "A", | ||
label: SKILLS.A.label, | ||
}, | ||
}, | ||
rushing: { | ||
ratings: ["stre", "spd", "elu"], | ||
weights: [0.5, 1, 1], | ||
skill: { | ||
label: "X", | ||
label: SKILLS.X.label, | ||
}, | ||
}, | ||
catching: { | ||
ratings: ["hgt", "hnd"], | ||
weights: [0.2, 1], | ||
skill: { | ||
label: "H", | ||
label: SKILLS.H.label, | ||
}, | ||
}, | ||
gettingOpen: { | ||
|
@@ -52,35 +98,35 @@ const COMPOSITE_WEIGHTS: CompositeWeights<RatingKey> = { | |
ratings: ["hgt", "stre", "spd", "pbk"], | ||
weights: [0.5, 1, 0.2, 1], | ||
skill: { | ||
label: "Bp", | ||
label: SKILLS.Bp.label, | ||
}, | ||
}, | ||
runBlocking: { | ||
ratings: ["hgt", "stre", "spd", "rbk"], | ||
weights: [0.5, 1, 0.4, 1], | ||
skill: { | ||
label: "Br", | ||
label: SKILLS.Br.label, | ||
}, | ||
}, | ||
passRushing: { | ||
ratings: ["hgt", "stre", "spd", "prs", "tck"], | ||
weights: [1, 1, 0.5, 1, 0.25], | ||
skill: { | ||
label: "PR", | ||
label: SKILLS.PR.label, | ||
}, | ||
}, | ||
runStopping: { | ||
ratings: ["hgt", "stre", "spd", "rns", "tck"], | ||
weights: [0.5, 1, 0.5, 1, 1], | ||
skill: { | ||
label: "RS", | ||
label: SKILLS.RS.label, | ||
}, | ||
}, | ||
passCoverage: { | ||
ratings: ["hgt", "spd", "pcv", "tck"], | ||
weights: [0.1, 1, 1, 0.25], | ||
skill: { | ||
label: "L", | ||
label: SKILLS.L.label, | ||
}, | ||
}, | ||
tackling: { | ||
|
@@ -485,6 +531,7 @@ const DEFAULT_DIVS: Div[] = [ | |
const DEFAULT_STADIUM_CAPACITY = 70000; | ||
|
||
export { | ||
SKILLS, | ||
AWARD_NAMES, | ||
DEFAULT_CONFS, | ||
DEFAULT_DIVS, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In addition to constants.basketball.ts and constants.football.ts, there's now also constants.hockey.ts :) Exciting times... |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same as the text-primary class built into Bootstrap.
Possibly those other classes could be replaced by something in Bootstrap too, not sure...