#!/usr/bin/env bash
# Whole rink visits of the simulation recordings (MwRinkAI, MwRinkSim,
# MwRinkUpdate, MwRinkPhases throughout) from each visit's first segment
# start with only the recorded pads and elapsed ticks (and the recorded
# tick reads, voice answers and pause answers): every pass's segment end
# and next segment start against the original's. One Godot process per
# recording.
#   tools/bin/visit-check [NAME ...] [--show N] [--from PASS] [--count N]
# -j N: N recordings at once (the output as one at a time).
source "$(dirname "${BASH_SOURCE[0]}")/_common.sh"
here="$(dirname "${BASH_SOURCE[0]}")"
source "$here/_recordings.sh"
names=(); opts=()
while (( $# )); do
  case "$1" in
    -j) export MW_JOBS="$2"; shift 2 ;;
    --show|--from|--count) opts+=("$1" "$2"); shift 2 ;;
    --*) opts+=("$1"); shift ;;
    *) names+=("$1"); shift ;;
  esac
done
if (( ${#names[@]} == 0 )); then
  names=("${MW_REC_V2[@]}" "${MW_REC_V3[@]}" "${MW_REC_SOAK[@]}")
fi
mw_each_recording res://test/sim/pass_check.gd "${names[@]}" -- --visit "${opts[@]}"
