feat: Saison-Upgrade-Prüfung und Kür-Vorbehalt bei Artistic
Die Kür kann jetzt gegen eine andere Saison verglichen werden, ohne sie umzustellen. `SeasonUpgradeCheck` vergleicht das Regelpaket der Kür mit dem einer Ziel-Saison und berichtet die Unterschiede für genau diese Kür: - Elemente, die es in der Ziel-Saison nicht gibt, und geänderte Base Values (einzeln und als Summe) - Features, die dort unbekannt sind, und Level, die sich daraus anders ergeben - geänderte Kategorie-Grenzen (Dauer, Anzahlen, Level-Caps, Pflichtelemente) - die Befunde der Prüfung gegen die Ziel-Saison Der Dialog hängt am Prüfdialog („ⓘ Gegen andere Saison prüfen …") und ist bewusst nicht exklusiv, damit er sich über den Prüfdialog legen kann. „Prüfen" ändert nichts; „Auf Saison umstellen" übernimmt nur die Saison und lässt die Elemente unangetastet. Zusätzlich: Der Prüfdialog und `docs/manual.md` stellen klar, dass die Adult-Kategorie-Grenzen für die Kür gelten – Artistic hat eigene Anforderungen und wird noch nicht geprüft (Entscheidung steht in der Roadmap).
This commit is contained in:
parent
dfe775ac34
commit
1b5649e7dd
10 changed files with 821 additions and 12 deletions
|
|
@ -18,6 +18,7 @@ func _init() -> void:
|
|||
_test_real_data_passes_audit()
|
||||
_test_broken_fixture_is_reported()
|
||||
_test_season_pair_difference()
|
||||
_test_upgrade_check()
|
||||
_cleanup()
|
||||
_finish()
|
||||
|
||||
|
|
@ -211,6 +212,58 @@ func _test_season_pair_difference() -> void:
|
|||
)
|
||||
|
||||
|
||||
## Die Saison-Upgrade-Prüfung berichtet Unterschiede, ohne die Kür zu ändern.
|
||||
func _test_upgrade_check() -> void:
|
||||
var library := RulesLibrary.scan()
|
||||
var current := library.get_package("2026/27")
|
||||
var older := library.get_package("2025/26")
|
||||
if current == null or older == null:
|
||||
_check(false, "both seasons load for the upgrade check")
|
||||
return
|
||||
|
||||
var routine := _make_pair_routine()
|
||||
var report := SeasonUpgradeCheck.run(routine, current, older)
|
||||
_check(report.source_season == "2026/27", "report names the source season")
|
||||
_check(report.target_season == "2025/26", "report names the target season")
|
||||
_check(report.has_changes(), "ChSp is reported as a change")
|
||||
var missing := report.changes_of(SeasonUpgradeCheck.KIND_MISSING_CODE)
|
||||
_check(missing.size() == 1, "one element is missing in the target season")
|
||||
if missing.size() == 1:
|
||||
_check(
|
||||
str(missing[0].label).contains("ChSp"),
|
||||
"the missing element is ChSp"
|
||||
)
|
||||
_check(
|
||||
report.base_value_before > 0.0 and report.base_value_after == 0.0,
|
||||
"the base value drops when the element disappears"
|
||||
)
|
||||
|
||||
var unchanged := SeasonUpgradeCheck.run(routine, current, current)
|
||||
_check(
|
||||
not unchanged.has_changes(),
|
||||
"comparing a season with itself reports no changes"
|
||||
)
|
||||
|
||||
# Category limits changed between the seasons (ChSp requirement, level caps).
|
||||
routine.adult_category = "gold"
|
||||
var category_report := SeasonUpgradeCheck.run(routine, current, older)
|
||||
var category_changes := category_report.changes_of(
|
||||
SeasonUpgradeCheck.KIND_CATEGORY_CHANGE
|
||||
)
|
||||
_check(
|
||||
category_changes.size() >= 2,
|
||||
"the category limits are part of the comparison"
|
||||
)
|
||||
var labels := PackedStringArray()
|
||||
for change: SeasonUpgradeCheck.Change in category_changes:
|
||||
labels.append(change.label)
|
||||
_check(labels.has("Pflichtelemente"), "the required elements are compared")
|
||||
_check(
|
||||
labels.has("Level-Grenzen (Pirouette/Sequenz)"),
|
||||
"the level caps are compared"
|
||||
)
|
||||
|
||||
|
||||
func _make_pair_routine() -> Routine:
|
||||
var routine := Routine.new()
|
||||
routine.routine_id = "season-pair"
|
||||
|
|
|
|||
|
|
@ -1756,6 +1756,41 @@ func _run() -> void:
|
|||
"an unknown season is rejected"
|
||||
)
|
||||
|
||||
# Saison-Upgrade-Prüfung: berichtet nur, ändert erst auf Bestätigung.
|
||||
controller.new_routine()
|
||||
controller.add_element_marker(
|
||||
Vector2(0.0, 0.0),
|
||||
PathSegment.ElementType.SPIN,
|
||||
"ChSp",
|
||||
1
|
||||
)
|
||||
controller.open_validation_dialog()
|
||||
controller._on_validation_meta_clicked("upgrade")
|
||||
_check(controller.upgrade_dialog.visible, "the upgrade dialog opens")
|
||||
_check(
|
||||
controller.validation_dialog.visible,
|
||||
"the check dialog stays open behind the comparison"
|
||||
)
|
||||
_check(
|
||||
controller.upgrade_text.text.contains("nicht im Katalog"),
|
||||
"the report names the element the target season lacks"
|
||||
)
|
||||
_check(
|
||||
not controller.upgrade_apply_button.disabled,
|
||||
"switching the season is offered after the check"
|
||||
)
|
||||
_check(
|
||||
controller.get_season() == "2026/27",
|
||||
"checking alone does not change the season"
|
||||
)
|
||||
controller._on_upgrade_apply_pressed()
|
||||
_check(
|
||||
controller.get_season() == "2025/26",
|
||||
"confirming switches the routine to the target season"
|
||||
)
|
||||
controller.upgrade_dialog.hide()
|
||||
controller.validation_dialog.hide()
|
||||
|
||||
controller.new_routine()
|
||||
|
||||
# Structured jump combination in the element dialog.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue