jonesguy14 / footballcoach

Android App for playing/simulating/recruiting as a college football coach
Other
34 stars 8 forks source link

Adding More Week 0 Stories #50

Closed destilla closed 8 years ago

destilla commented 8 years ago

Added additional Week 0 stories and now save the blessed and cursed teams from year to year as actual teams rather than just strings. This lets me grab their name, abbr, rival, players, etc; all the good stuff you might want out of a team.

The stories are setup with a switch statement that randomly picks one and adds it to the week 0 news. Some cases have other conditions that will make one story or another appear.

As usual, sorry if the formatting is "wtf" weird on the changes, I don't have a local git situation set up so I just do it through the webapp. Nothing seemed egregious.

jonesguy14 commented 8 years ago

Looks mostly good but I have a suggestion before I merge.

Right now it looks like you save all the details of the cursed and blessed teams, like the wins, losses, all the players, etc, just like how its done when saving the rest of the teams normally. Then you create a Team object from this string.

But League has functions like findTeam(..) and findTeamAbbr(..) that will find the correct team given their name or abbreviation. So I think that you can just save the bless/curse team's name in the file, and then find the actual Team obj corresponding to those names using the functions (and therefore all the players, stats, etc associated with that team). This will negate the need to save the entire curse/bless team over, when they are already saved in an earlier part of the file.

Not sure if that's clear, or maybe you already considered this and need it saved like you have it.

destilla commented 8 years ago

That actually seems like a way simpler way of doing things. I'll look into this tomorrow and will close this merge request for now, because I know that your method is a lot neater and way more efficient. How I wanted this to work changed three times throughout the day and I didn't stick with making them teams until about 3 hours ago, so I didn't get much time to put thought into a better way of handling that.

Unfortunately right now I'm running late for dinner with my gf; sorry! Thanks for the suggestion though! I definitely want to take another crack at this.

Edit: fixed some typos