// SPDX-License-Identifier: GPL-3.0-only #pragma once #include "modern/ui/catalog.hpp" namespace bmh::modern_ui { // Presentation-only construction ledger. Only state.stadium is owned here: // {club,budget,blocks:[{places,seats,roof,job}],facilities:[{level,job}],periphery:[{level,job}]}. // All money is currency minor units. Includes fourteen independent periphery sites. // No ticket, navigation, engine, // random stream, world edit, legacy initialization, or completion timer. Json demo_stadium(const Catalog &, const std::string &club = {}); bool valid_demo_stadium(const Json &state, const Catalog &, const std::string &club = {}); // Initialize only an entirely absent stadium object. Existing invalid data is // rejected unchanged; budget plus all correctly priced pending jobs is 50M. bool migrate_demo_stadium(Json &state, const Catalog &, const std::string &club = {}); // Only {kind:"build",request:{kind:"block",index,places,seats,roof}} or // {kind:"build",request:{kind:"facility"|"periphery",index,level}}. // Periphery targets must be exactly the completed level plus one. Recompute the quote, // atomically debit only local stadium budget and stage a pending job. std::string edit_demo_stadium(Json &state, const Json &action, const Catalog &, const std::string &club = {}); // {ok,can_build,error,request,kind,index,cost,weeks,budget,remaining, // placesCost,seatsCost,roofCost}. All monetary values are raw minor units. // Invalid input/downgrades => ok=false; no-op, pending target or insufficient // budget => ok=true,can_build=false with a precise error and usable quote. // Explicit club wins; otherwise the active full-state manager club, then legacy first // manageable club, or "" for a catalogue without manageable clubs. Json demo_stadium_quote(const Json &state, const Json &request, const Catalog &, const std::string &club = {}); // {budget_cap,blocks:[index,letter,name,max_places,rate,weeks], // facilities:[index,name,max_level,rate,weeks,levels]}. Rates are raw; level // 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,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/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