+ if (match['gender_rule_a']) {
+ if (type === 'restart' && !between_points) {
+ let predominant_gender = find_predominant_gender(players);
+ let num_players_on_field = find_num_players_on_field(players);
+ if (predominant_gender !== current_predominant_gender && current_predominant_gender !== null) {
+ console.log(match['description'] + ' ' + format_time(t) + ': Stoppage changed predominant gender from ' + current_predominant_gender + ' to ' + predominant_gender);
+ }
+ if (num_players_on_field !== current_num_players_on_field && current_num_players_on_field !== null) {
+ console.log(match['description'] + ' ' + format_time(t) + ': Stoppage changed number of players on field from ' + current_num_players_on_field + ' to ' + num_players_on_field);
+ }
+ current_predominant_gender = predominant_gender;
+ current_num_players_on_field = num_players_on_field;
+ } else if (type === 'pull' || type === 'their_pull') {
+ let predominant_gender = find_predominant_gender(players);
+ let num_players_on_field = find_num_players_on_field(players);
+ let changed = (predominant_gender !== current_predominant_gender);
+ if (point_num !== 0) {
+ let should_change = (point_num % 4 == 1 || point_num % 4 == 3); // ABBA changes on 1 and 3.
+ if (changed && !should_change) {
+ console.log(match['description'] + ' ' + format_time(t) + ': Gender ratio should have stayed the same, changed to predominance of ' + predominant_gender);
+ } else if (!changed && should_change) {
+ console.log(match['description'] + ' ' + format_time(t) + ': Gender ratio should have changed, remained predominantly ' + predominant_gender);
+ }
+ if (num_players_on_field !== current_num_players_on_field && current_num_players_on_field !== null) {
+ console.log(match['description'] + ' ' + format_time(t) + ': Number of players on field changed from ' + current_num_players_on_field + ' to ' + num_players_on_field);
+ }
+ }
+ current_predominant_gender = predominant_gender;
+ current_num_players_on_field = num_players_on_field;
+ }
+ }
+ if (match['gender_pull_rule']) {
+ if (type === 'pull') {
+ if (current_predominant_gender !== null &&
+ p.gender !== current_predominant_gender) {
+ console.log(match['description'] + ' ' + format_time(t) + ': ' + p.name + ' pulled, should have been ' + current_predominant_gender);
+ }
+ }
+ }
+