zengm-games / zengm

Basketball GM (and other ZenGM games) are single-player sports management simulation games, made entirely in client-side JavaScript.
https://zengm.com
Other
349 stars 127 forks source link

Frivolity for oldest teams and youngest teams to win championships #424

Closed maxkarnold closed 2 years ago

maxkarnold commented 2 years ago

Here's the reddit post: https://old.reddit.com/r/BasketballGM/comments/o668ok/a_teams_average_age_weighted_by_minutes_played_is/h2rbp7g/?context=3

I saw this on the TODO list and it looked like it wouldn't be that hard to implement. Not exactly sure how I want to implement it. I figured I'd start easy and just get the average age of the teams and just sort by that number.

dumbmatter commented 2 years ago

Nobody's working on it.

These would actually be pretty easy, I think. https://github.com/zengm-games/zengm/blob/master/src/worker/views/frivolitiesTeamSeasons.ts is the code to handle all the "best/worst team" frivolities. The "team season" object (usually called ts in that file) has a property called avgAge that contains the average age of the team at the start of the playoffs (undefined prior to playoffs), so you could just use that as your "value".

Beyond a little bit of code there, I think you'd just need to add it to the list of frivolities in https://github.com/zengm-games/zengm/blob/master/src/ui/views/Frivolities.tsx

I could be forgetting something of course :)

Also since you're new here... before you write any code, make sure you're okay with the license https://github.com/zengm-games/zengm/blob/master/LICENSE.md and send me a copy of the CLA to jeremy@zengm.com https://github.com/zengm-games/zengm/blob/master/CLA-individual.md

maxkarnold commented 2 years ago

Yeah, I sent you the CLA a little while back and you shared the LICENSE.md with me on discord. I am Maquillarme/Max on discord.

dumbmatter commented 2 years ago

Damn it I just checked Discord and figured that out, right before I got this notification lol

Can you send the CLA again? I can't seem to find it, sorry.