]> git.sesse.net Git - ultimatescore/commitdiff
Implement support for XY5, etc.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 29 Sep 2021 17:46:22 +0000 (19:46 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 29 Sep 2021 17:46:22 +0000 (19:46 +0200)
update_sheets.js

index 9a1fff4531abbfe116f6d1d2cf55795092f54d29..bd3f9e70340530d335e29bb2d8d652d38f5e2dd0 100644 (file)
@@ -262,6 +262,26 @@ function montecarlo(all_teams, groups, games, groups_to_calc) {
                }
        }
 
+       // These are pretty hard-coded, but that's probably fine. Must come after we've concretized X, Y, etc.
+       for (const group_name of real_group_names) {
+               let teams = filter_teams_by_group(all_teams, groups, 'Group ' + group_name);
+               if (teams.length >= 5) {
+                       for (const other_group_name of real_group_names) {
+                               replacements.push([ group_name + other_group_name + '5', group_name + '5' ]);
+                       }
+                       for (const other_group_name of pseudo_group_names) {
+                               replacements.push([ group_name + other_group_name + '5', group_name + '5' ]);
+                       }
+               } else {  // Perhaps a bit overkill.
+                       for (const other_group_name of real_group_names) {
+                               replacements.push([ group_name + other_group_name + '5', other_group_name + '5' ]);
+                       }
+                       for (const other_group_name of pseudo_group_names) {
+                               replacements.push([ group_name + other_group_name + '5', other_group_name + '5' ]);
+                       }
+               }
+       }
+
        for (let group_idx = 0; group_idx < groups_to_calc.length; ++group_idx) {
                for (let i = 0; i < teams[group_idx].length; ++i) {
                        if (teams[group_idx][i].simulated_rank !== null) {