Commit Graph

33 Commits

Author SHA1 Message Date
Daniel Schädler 5b2a969857 Implement update_group_score method
This method calculates all the group scores of the group given to it
2019-05-29 23:02:59 +02:00
Daniel Schädler 08b190e65b Move self methods into self block 2019-05-29 23:02:59 +02:00
Daniel Schädler 6f44823bc6 Change match state of match below 2019-05-26 20:15:59 +02:00
Daniel Schädler 8bdcd51e66 Move all methods in playoff_stage_service into self block 2019-05-26 20:15:59 +02:00
Daniel Schädler 645f3d0800 Return changed objects in populate_match_below 2019-05-26 20:15:58 +02:00
Daniel Schädler 95bed3959f Actually make singleton_methods private
(Rubocop told me so and I trust the police)
2019-05-26 20:15:58 +02:00
Daniel Schädler cda7d168f5 Save match_scores explicitly after changing them 2019-05-26 20:15:58 +02:00
Daniel Schädler 93cea002f9 Change the way, existing match_scores are handled 2019-05-26 20:15:58 +02:00
Daniel Schädler 7a9da4e22d Rearrange methods in playoff_stage_service 2019-05-26 20:15:58 +02:00
Daniel Schädler 27d6269f94 Rearrange new methods into one to split it later on 2019-05-26 20:15:58 +02:00
Daniel Schädler 4e907b1fc8 Improve Formatting in playoff_stage_service (I guess)
... Rubocop wanted it that way
2019-05-26 20:15:16 +02:00
Daniel Schädler e4c868c150 Fix second match winner advancing, even if match is not finished 2019-05-26 20:15:16 +02:00
Daniel Schädler c9b07f7033 Implement populate_match_below method 2019-05-26 20:14:13 +02:00
Daniel Schädler 2f77d2d25b Add winner method to match 2019-05-26 20:14:13 +02:00
Thor77 37b63cace2
Use methods instead of attributes
because each attribute is only used once and updating a Stage should
reflect those changes
2019-05-16 20:53:05 +02:00
Thor77 d6a691fe5a
Add documentation to sort_group_scores 2019-05-16 20:53:05 +02:00
Thor77 bdcfbe934b
Add StatisticsService 2019-05-16 20:53:04 +02:00
Daniel Schädler f7ed4b549d Destroying all Readability.
Noone will ever be able to read this code again.
2019-05-04 20:54:08 +02:00
Daniel Schädler 23249ee93b Build Matches without saving directly to database 2019-05-04 20:34:57 +02:00
Daniel Schädler db1518bdbd Raise exceptions upon error in group_stage_service 2019-05-04 20:34:57 +02:00
Daniel Schädler fdac71a9f1 Unnecessary variable assignment 2019-05-04 20:34:57 +02:00
Daniel Schädler a842e0db3c Add group stage service
This service is responsible for all actions concerning the group stage
It returns false if no groups are given to generate_group_stage method
This prevents dividing by zero in the next line
2019-05-04 20:34:57 +02:00
Daniel Schädler d3d572ea1b Change return for 0 teams to exception 2019-04-23 14:21:29 +02:00
Daniel Schädler a30ff860e9 Return a valid list of matches for 1 team 2019-04-23 14:19:36 +02:00
Daniel Schädler 38425df823 Only support stage count calculation for 1+ teams 2019-04-23 14:19:36 +02:00
Daniel Schädler 49a6545af9 Fix start point for stages with matchnumbers that are not powers of 2 2019-04-23 14:19:36 +02:00
Daniel Schädler 1c2d051364 Subtract one off required stages if the number of teams is a power of 2
This way we now calculate the right amount of stages for every number.
(I would test every number, but Jonas won't let me write tests for all of them..)
2019-04-23 14:19:36 +02:00
Daniel Schädler 7f87ce9230 Add documentation for all services 2019-04-03 15:33:59 +02:00
Daniel Schädler 68f9b3b2b3 Change Score to MatchScore & MatchScore score attribute to points
This is done to improve the naming and therefore make things easier to understand.
2018-11-30 14:15:48 +01:00
Daniel Schädler 26bcc3dc88 Implement Adding Playoffs to a tournament 2018-11-29 11:10:15 +01:00
Daniel Schädler 7f243b06a2 Implement Utils Class 2018-11-29 11:03:44 +01:00
Daniel Schädler a13b8e0c72 Change neededGames to needed_games 2018-11-12 16:45:51 +01:00
Daniel Schädler d5d61ec0a2 Add some Models 2018-11-11 18:52:15 +01:00