jonesguy14 / footballcoach

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

Updated Conf Schedule to Alternate Home/Away #55

Closed destilla closed 8 years ago

destilla commented 8 years ago

updated setUpSchedule() to generate a list of "even year home games" upon league creation, and then save these values in the saveFile string, and move them from year to year.

When setting up the schedule, instead of have a 50/50 chance of assigning team A to be the home team or else team B, a check is made to see if it's an even year, and team B falls within team A's even year home games, then if it's an odd year and team B does not fall into that list, etc, until all scenarios have been accounted for and teams are assigned a home or away game for each conference game accordingly.

This opens up the door to track home games played (for potentially forcing the user to keep within a certain number of home games, as we don't have an FCS division) and for setting up the ability to set up a home and home in the event we want to go there with the OOC selection.

jonesguy14 commented 8 years ago

I've been pretty busy with school the last couple days but I like this change a lot, much more realistic. I looked over the code and it seems good, I trust that you tested it to make sure its all functioning well. Not sure why 34 commits showed up though lol.

destilla commented 8 years ago

I have no idea what Github is doing, especially since I submitted the merge request from my master branch and a lot of those commits are from another branch I've got with different team names/first + last name, etc. Little side stuff I like to have for when I play.

Testing: Oh yes. I tested this thing so much. It's actually how I ended up finding a solution; I thought I had it figured out, testing broken it into 70 little pieces, then I deliberated until I came to what I have now.

The only issue I'm seeing is that because there's an algorithm used to determine what order you play teams in a given year (0 plays 9 1 plays 2 etc week 1 and then on down the line with the other weeks as the equations pan out for team a and team b), and because it's pre-determined who is away and who is home, you sometimes end up with weird streaks of 4 road games followed by 3 home games, or 3 road games in a row to end the year. I think that might just be chance though.

Every, functionally speaking, has behaved as it should when I tested it. New seasons, playing through years on a new season, saving/loading, loading and playing through several season then saving again, etc.

I don't know if you made a change somewhere but it appears the Week 0 news stories are appearing as they were intended too now, as well.

jonesguy14 commented 8 years ago

Weird streaks of 4 road games in a row or 3 home games in a row are totally ok, either one is better than before, where some teams would get unlucky and play 10 road games in a season or something ridiculous like that lol. Great work!

destilla commented 8 years ago

Good thing I can code better than I can type: "too now, as well" -- not sure that could have been more ham handed. And agreed, situations like that even happen in the real world, just thought it was worth mentioning. Thanks!