Skip to content
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

Total stats within play by play #454

Open
jdabapo opened this issue Aug 2, 2023 · 0 comments
Open

Total stats within play by play #454

jdabapo opened this issue Aug 2, 2023 · 0 comments

Comments

@jdabapo
Copy link

jdabapo commented Aug 2, 2023

Attempting to do this from the TODO list:
show totals for pts/reb/ast/etc in play by play like "J. Brown Driving layup (12 pts) D. White (3 AST)" https://old.reddit.com/r/BasketballGM/comments/z99cby/monthly_suggestions_thread/j26zhxu/

Was looking in GameSim.basketball/index.ts, and thought it would make the most sense to insert it within the recordPlay function. I think that grabbing the player information (if available) then putting the correct information into the respective play type:
Ex:
texts = ["{0} grabbed the offensive rebound"];
would become
texts = ["{0} grabbed the offensive rebound {this.team[0].player[0].stat.orb}"];
But, since the way the names are inserted into the text is not a f-string, I was thinking of doing something similar to the code here, but using different keys other than 0 and 1 (like stl? or o_pts?)
(

if (names) {
for (let i = 0; i < names.length; i++) {
text = text.replace(`{${i}}`, names[i]);
}
}
)
However, a problem with this approach would be since that there are a number of different stats such as points, assists, etc. there would be quite a lot added with this, but if this was switched to using a f-string it would be easier to just change each of the texts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant