Fix Super-Stadion full-upgrade image selection (by Codex)
This commit is contained in:
1 parent
8b3b51de55
commit
a207b0129e
4 files changed
+105
-11
No files matched your search
@@ -133,10 +133,23 @@ IDs 6–13 ausschließlich ihren Marker bis zur Zukunftsvorschau. Das Panorama
|
||||
bleibt Wiese/Wald ohne Skyline oder Animation. Die Stadionvariante folgt der
|
||||
physischen fertigen Blockgröße, in Zukunft der Zielkapazität; gesperrte Blöcke
|
||||
verkleinern nur die verfügbare Kapazitätszahl, nicht die fertige Stadiongrafik.
|
||||
Die fünf Variantengrenzen lauten 10.000/25.000/50.000/75.000/100.000.
|
||||
Die fünf gewöhnlichen Kapazitätsstufen wechseln bei
|
||||
10.000/25.000/50.000/75.000 Plätzen. Die sechste Grafik ist dem Super-Stadion
|
||||
vorbehalten: Jeder der acht Innenblöcke muss sein individuelles Platzmaximum
|
||||
erreichen, vollständig bestuhlt und überdacht sein. „Aktuell“ prüft den fertigen
|
||||
Bestand, „Zukunft“ berücksichtigt gebuchte Zielzustände. Eine feste
|
||||
100.000-Plätze-Grenze entscheidet diesen Vollausbau nicht.
|
||||
Der Vollausbauzustand des Exports ist ausschließlich Referenz, kein Startbestand.
|
||||
Die Demo startet Verkehr/Parkplatz/Restaurant auf Stufe 1, andere Standorte auf 0.
|
||||
|
||||
Die native Regelkorrektur vom 26. Oktober 2026 basiert auf `8b3b51d`.
|
||||
Synthetische Grenztests prüfen jeden Block einzeln unter seinem Maximum, ohne
|
||||
Dach und ohne vollständige Bestuhlung sowie den gebuchten Vollausbau. Die
|
||||
Stadion- und DemoSource-Komponententests bestehen. Fünf frische native Läufe
|
||||
bei Midnight/1080p bestehen mit 100/100 Prüfbedingungen einschließlich aller
|
||||
vierzehn Umfeldbereiche, genau zwei Navigationsknöpfen und unveränderten
|
||||
Spieldaten beim Wechsel zwischen „Aktuell“ und „Zukunft“.
|
||||
|
||||
Die Umfeldpreise pro Stufe sind in angezeigten Einheiten 700.000/800.000/
|
||||
1.800.000/650.000/450.000/550.000, je Imbiss 90.000 und je Fan-Shop 140.000.
|
||||
Bauwochen sind 12/14/28/16/9/12, je Imbiss 4 und je Fan-Shop 6. Diese Werte
|
||||
@@ -193,10 +206,12 @@ Hover-Bauwochen, Zukunft/Rückkehr und unveränderte Demo-/Checkpointdaten.
|
||||
Innenansicht und Stadiondaten behalten ihre Informationen. Die beiden
|
||||
gezielten Stadion-/DemoSource-Komponententests bestehen ebenfalls.
|
||||
|
||||
Das bestehende Innen-Demomodell endet bei zusammen 96.000 Plätzen. Der
|
||||
vollständig ausgebaute native Fixturestand verwendet daher die fünfte
|
||||
Stadiongrafik. Die sechste Grafik ab 100.000 und ihre Grenzwahl werden
|
||||
synthetisch geprüft; durch die derzeitigen Innen-Demoaktionen ist dieser
|
||||
Stand nicht erreichbar. Baufortschritt, Fertigstellung und Abbruch eines
|
||||
Das bestehende Innen-Demomodell endet bei zusammen 96.000 Plätzen. Sind dabei
|
||||
alle acht Blöcke vollständig bestuhlt und überdacht, erscheint die sechste
|
||||
Stadiongrafik. Bereits ein fehlendes Dach, Stehplätze oder ein Block unter seinem
|
||||
Maximum lassen die gewöhnliche Kapazitätsgrafik bestehen. Ausschließlich
|
||||
gebuchter Vollausbau erscheint erst in „Zukunft“ als Super-Stadion. Diese Regel
|
||||
gehört zur nativen UI-Demo; sie ändert weder Classic noch eine Engineberechnung.
|
||||
Baufortschritt, Fertigstellung und Abbruch eines
|
||||
gebuchten Auftrags bleiben offene Engineentscheidungen. Die Prüfung belegt
|
||||
keine Windows-/macOS-Laufzeitabnahme und keine neue Classic-Freigabe.
|
||||
@@ -271,11 +271,15 @@ Json demo_stadium_view(const Json &state, const Catalog &world, bool future, con
|
||||
}
|
||||
auto rules = demo_stadium_rules(world);
|
||||
int64_t pending = 0, available = 0, planned = 0;
|
||||
bool super_stadium = true;
|
||||
for (size_t i = 0; i < 8; ++i) {
|
||||
const auto &base = stadium.at("blocks")[i];
|
||||
const auto &job = base.at("job");
|
||||
const bool building = !job.is_null();
|
||||
const auto &display = future && building ? job : base;
|
||||
super_stadium = super_stadium &&
|
||||
display.at("places").get<int64_t>() == capacities[i] &&
|
||||
display.at("seats").get<bool>() && display.at("roof").get<bool>();
|
||||
auto &row = rules["blocks"][i];
|
||||
for (const auto *key : {"places", "seats", "roof", "job"}) row[key] = base.at(key);
|
||||
row["building"] = building;
|
||||
@@ -305,6 +309,7 @@ Json demo_stadium_view(const Json &state, const Catalog &world, bool future, con
|
||||
int64_t physical = 0;
|
||||
for (const auto &block : stadium.at("blocks")) physical += block.at("places").get<int64_t>();
|
||||
rules["physical_capacity"] = future ? planned : physical;
|
||||
rules["super_stadium"] = super_stadium;
|
||||
rules["ok"] = true; rules["club"] = id; rules["club_name"] = team ? world.name(*team) : "—";
|
||||
rules["stadium"] = record ? record->at("id") : Json();
|
||||
const auto name = record ? world.name(*record) : "";
|
||||
@@ -339,8 +344,14 @@ Json demo_stadium_scene(const Json &configuration, const Json &overview, bool fu
|
||||
place(profile.at("backgroundOptions")[0].at("variants").at(size_t(traffic)),
|
||||
{{"x", background.at("offsetX")}, {"y", background.at("offsetY")}, {"scale", background.at("scale")}, {"z", 0}}, "background", "background");
|
||||
const auto capacity = overview.at("physical_capacity").get<int64_t>();
|
||||
// The sixth image is a fully upgraded bowl, not another capacity tier.
|
||||
size_t stadium_index = 0;
|
||||
for (const auto &threshold : profile.at("stadium").at("thresholds")) if (capacity >= threshold.get<int64_t>()) ++stadium_index;
|
||||
if (overview.at("super_stadium").get<bool>()) stadium_index = 5;
|
||||
else {
|
||||
const auto &thresholds = profile.at("stadium").at("thresholds");
|
||||
for (size_t i = 0; i < 4 && i < thresholds.size(); ++i)
|
||||
if (capacity >= thresholds[i].get<int64_t>()) ++stadium_index;
|
||||
}
|
||||
place(profile.at("stadium").at("variants").at(stadium_index), profile.at("stadium").at("transform"), "stadium", "stadium");
|
||||
for (size_t i = 0; i < 14; ++i) {
|
||||
const auto &object = profile.at("objects")[i], &row = overview.at("periphery")[i];
|
||||
|
||||
@@ -34,15 +34,20 @@ Json demo_stadium_quote(const Json &state, const Json &request, const Catalog &,
|
||||
// labels are 1-based with an empty entry at index 0. No artwork is required.
|
||||
Json demo_stadium_rules(const Catalog &);
|
||||
// {ok,club,club_name,name,stadium,budget,budget_cap,pending_cost,
|
||||
// available_capacity,planned_capacity,capacity,blocks,facilities}.
|
||||
// available_capacity,planned_capacity,capacity,physical_capacity,super_stadium,
|
||||
// blocks,facilities,periphery}.
|
||||
// Rule rows above are augmented with unchanged base values/job/building plus
|
||||
// display_places/seats/roof or display_level/label for the requested view.
|
||||
// Current capacity excludes a block with any pending job; future uses its target.
|
||||
// super_stadium requires every block at its own maximum with seats and roof:
|
||||
// completed values in Current, queued targets where present in Future.
|
||||
// Stadium identity comes from the catalogue, not its initialization policies.
|
||||
Json demo_stadium_view(const Json &state, const Catalog &, bool future = false,
|
||||
const std::string &club = {});
|
||||
// Pure calibrated sprite layout. Ignores exported simulation/editor/object state;
|
||||
// uses only runtime overview capacity and periphery jobs. Coordinates remain in
|
||||
// uses only runtime overview capacity/full-upgrade status and periphery jobs.
|
||||
// Five ordinary capacity images remain; the sixth requires super_stadium.
|
||||
// Coordinates remain in
|
||||
// the 1920x1080 reference space; stable layers include full transparent canvases.
|
||||
Json demo_stadium_scene(const Json &configuration, const Json &overview, bool future);
|
||||
} // namespace bmh::modern_ui
|
||||
@@ -213,15 +213,78 @@ void periphery() {
|
||||
}
|
||||
require(overlay&&marker,"Missing parking overlay or independent snack marker");
|
||||
for(const auto &layer:future.at("layers"))require(layer.at("role")!="overlay"&&layer.at("role")!="marker","Future preview retains construction overlay");
|
||||
auto overview=demo_stadium_view(state,world);const std::array<int,5> boundaries{10000,25000,50000,75000,100000};
|
||||
auto overview=demo_stadium_view(state,world);const std::array<int,4> boundaries{10000,25000,50000,75000};
|
||||
for(size_t i=0;i<boundaries.size();++i)for(int delta:{-1,0}) {overview["physical_capacity"]=boundaries[i]+delta;require(demo_stadium_scene(config,overview,false).at("stadium_index")==i+(delta==0),"Capacity boundary selects wrong stadium");}
|
||||
overview["physical_capacity"]=100000;
|
||||
require(demo_stadium_scene(config,overview,false).at("stadium_index")==4,"Capacity alone selected the reserved Super-Stadion image");
|
||||
require(config==keep,"Scene projection mutated calibrated export");
|
||||
auto block_state=defaults;build(block_state,block(0,4000),world);require(demo_stadium_view(block_state,world).at("physical_capacity")==36000&&demo_stadium_view(block_state,world,true).at("physical_capacity")==37000,"Closed block shrinks physical stadium artwork");
|
||||
}
|
||||
}
|
||||
void super_stadium() {
|
||||
for (int precision : {0, 2}) {
|
||||
Fixture fixture(precision);
|
||||
const auto &world = *fixture.world;
|
||||
Json full = Json::object();
|
||||
require(migrate_demo_stadium(full, world), "Initialize Super-Stadion fixture");
|
||||
const auto rules = demo_stadium_rules(world), config = scene_fixture();
|
||||
int maximum = 0;
|
||||
for (size_t i = 0; i < 8; ++i) {
|
||||
const int places = rules.at("blocks")[i].at("max_places").get<int>();
|
||||
full["stadium"]["blocks"][i] = {{"places", places}, {"seats", true}, {"roof", true}, {"job", nullptr}};
|
||||
maximum += places;
|
||||
}
|
||||
require(maximum == 96000 && valid_demo_stadium(full, world), "Full block maxima or stadium fixture invalid");
|
||||
const auto verify = [&](const Json &state, bool future, bool expected) {
|
||||
const auto before = state;
|
||||
const auto view = demo_stadium_view(state, world, future);
|
||||
const auto scene = demo_stadium_scene(config, view, future);
|
||||
require(view.at("ok") == true && view.at("super_stadium") == expected,
|
||||
"Super-Stadion predicate ignores a block capacity/seat/roof boundary");
|
||||
require(scene.at("stadium_index") == (expected ? 5 : 4),
|
||||
"Full-upgrade status selected the wrong stadium image");
|
||||
require(view.at("periphery").size() == 14 && scene.at("areas").size() == 14 && state == before,
|
||||
"Super-Stadion projection changed periphery or source state");
|
||||
};
|
||||
verify(full, false, true);
|
||||
verify(full, true, true);
|
||||
for (size_t i = 0; i < 8; ++i) {
|
||||
auto unroofed = full;
|
||||
unroofed["stadium"]["blocks"][i]["roof"] = false;
|
||||
verify(unroofed, false, false);
|
||||
verify(unroofed, true, false);
|
||||
auto standing = full;
|
||||
standing["stadium"]["blocks"][i]["seats"] = false;
|
||||
verify(standing, false, false);
|
||||
verify(standing, true, false);
|
||||
auto smaller = full;
|
||||
smaller["stadium"]["blocks"][i]["places"] = rules.at("blocks")[i].at("max_places").get<int>() - 1000;
|
||||
verify(smaller, false, false);
|
||||
verify(smaller, true, false);
|
||||
build(unroofed, block(int(i), rules.at("blocks")[i].at("max_places").get<int>(), true, true), world);
|
||||
verify(unroofed, false, false);
|
||||
verify(unroofed, true, true);
|
||||
}
|
||||
auto queued = full;
|
||||
for (size_t i = 0; i < 8; ++i) {
|
||||
auto &base = queued["stadium"]["blocks"][i];
|
||||
base["places"] = rules.at("blocks")[i].at("max_places").get<int>() - 1000;
|
||||
base["seats"] = false;
|
||||
base["roof"] = false;
|
||||
}
|
||||
for (size_t i = 0; i < 8; ++i)
|
||||
build(queued, block(int(i), rules.at("blocks")[i].at("max_places").get<int>(), true, true), world);
|
||||
conserved(queued, world, precision ? 100 : 1);
|
||||
verify(queued, false, false);
|
||||
verify(queued, true, true);
|
||||
require(demo_stadium_view(queued, world).at("physical_capacity") == 88000 &&
|
||||
demo_stadium_view(queued, world, true).at("physical_capacity") == 96000,
|
||||
"Queued maximum was treated as already completed");
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
int main() try {
|
||||
currency(0); currency(2); periphery();
|
||||
currency(0); currency(2); periphery(); super_stadium();
|
||||
Fixture empty(0, false); Json state = {{"cash", 77}, {"ticket", 13}};
|
||||
require(migrate_demo_stadium(state, *empty.world) && valid_demo_stadium(state, *empty.world) && state.at("stadium").at("club") == "" && demo_stadium_view(state, *empty.world).at("stadium").is_null() && demo_stadium_view(state, *empty.world).at("name") == "Stadion", "Zero-club fixture invented identity or crashed");
|
||||
const auto saved = state; require(!migrate_demo_stadium(state, *empty.world, "club:missing") && state == saved, "Invalid explicit club accepted");
|
||||
|
||||
Reference in new issue
Block a user