# Architektur: tft ## Komponente: API-Schnittstelle beschreibung: Stellt HTTP-Endpunkte bereit, über die TFT-Partien gesteuert, erstellt und ausgelesen werden können. einheiten: backend/tft/api/app.py::ActionRequest, backend/tft/api/app.py::_load_game_deps, backend/tft/api/app.py::action, backend/tft/api/app.py::health, backend/tft/api/app.py::new_game, backend/tft/api/app.py::serialize, backend/tft/api/app.py::state, backend/tft/api/app.py::unit_view, backend/tft/api/app.py::upgrade_hint beziehungen: - nutzt: Spielsimulation - wird-genutzt-von: Kommandozeile ## Komponente: Kommandozeile beschreibung: Bietet das CLI-Werkzeug `tft` und verzweigt Subcommands auf die passenden Pipeline-Funktionen. einheiten: backend/tft/cli.py::current_set, backend/tft/cli.py::main beziehungen: - nutzt: API-Schnittstelle ## Komponente: Konstanten beschreibung: Lädt und validiert die TOML-Konstantendatei eines TFT-Sets. einheiten: backend/tft/constants/loader.py::load_constants, backend/tft/constants/loader.py::validate ## Komponente: Match-Datenpersistenz beschreibung: Stellt die SQLite-Verbindung bereit und crawlt, extrahiert und validiert gewertete TFT-Matches. einheiten: backend/tft/db.py::connect, backend/tft/matches/crawl.py::crawl, backend/tft/matches/extract.py::extract_all, backend/tft/matches/extract.py::extract_match, backend/tft/matches/extract.py::patch_of, backend/tft/matches/extract.py::validate_ids, backend/tft/matches/riot.py::RiotClient, backend/tft/matches/riot.py::_load_env, backend/tft/matches/riot.py::api_key beziehungen: - nutzt: Statische Daten ## Komponente: Statische Daten beschreibung: Bezieht, parst und versioniert die normalisierten TFT-Rohdaten von Community Dragon. einheiten: backend/tft/staticdata/fetch.py::fetch_static, backend/tft/staticdata/fetch.py::load_static, backend/tft/staticdata/parse.py::augment_tier, backend/tft/staticdata/parse.py::detect_set, backend/tft/staticdata/parse.py::icon_url, backend/tft/staticdata/parse.py::parse, backend/tft/staticdata/parse.py::render_desc, backend/tft/staticdata/parse.py::resolve_spell beziehungen: - wird-genutzt-von: Match-Datenpersistenz ## Komponente: Modell und Artefakt beschreibung: Baut das versionierte Analyse-Artefakt aus Statikdaten und erlernt Stärke-Multiplikatoren aus Endboards. einheiten: backend/tft/model/artifact.py::_augment_specs, backend/tft/model/artifact.py::build, backend/tft/model/artifact.py::component_pool, backend/tft/model/artifact.py::craftable_items, backend/tft/model/artifact.py::load, backend/tft/model/artifact.py::recipes, backend/tft/model/artifact.py::save, backend/tft/model/artifact.py::spell_dps_cap, backend/tft/model/augments.py::_num, backend/tft/model/augments.py::build_spec, backend/tft/model/augments.py::build_specs, backend/tft/model/baseline.py::classify_role, backend/tft/model/baseline.py::unit_value, backend/tft/model/calibrate.py::_holdout_scores, backend/tft/model/calibrate.py::_ranks, backend/tft/model/calibrate.py::board_from_row, backend/tft/model/calibrate.py::calibrate, backend/tft/model/calibrate.py::spearman, backend/tft/model/learn.py::_multiplier, backend/tft/model/learn.py::learn, backend/tft/model/learn.py::learn_from_db, backend/tft/model/score.py::active_trait_tiers, backend/tft/model/score.py::board_profiles, backend/tft/model/score.py::score_board, backend/tft/model/score.py::unit_profile, backend/tft/model/statsheet.py::_apply_item_effects, backend/tft/model/statsheet.py::_empty_acc, backend/tft/model/statsheet.py::_fraction, backend/tft/model/statsheet.py::item_is_modeled, backend/tft/model/statsheet.py::trait_buffs, backend/tft/model/statsheet.py::unit_stats, backend/tft/paths.py::artifact_dir, backend/tft/paths.py::latest_artifact_pointer, backend/tft/paths.py::latest_static_pointer, backend/tft/paths.py::static_dir beziehungen: - nutzt: Statische Daten - wird-genutzt-von: Spielsimulation ## Komponente: Spielsimulation beschreibung: Simuliert vollständige TFT-Partien als endliche Zustandsmaschine inklusive Kampf, Wirtschaft, Shop und Autoplay. einheiten: backend/tft/sim/autoplay.py::play_afk, backend/tft/sim/autoplay.py::play_econ, backend/tft/sim/autoplay.py::run, backend/tft/sim/combat.py::FightResult, backend/tft/sim/combat.py::_queue, backend/tft/sim/combat.py::_suffix_off, backend/tft/sim/combat.py::fight, backend/tft/sim/combat.py::player_damage, backend/tft/sim/economy.py::apply_xp, backend/tft/sim/economy.py::interest, backend/tft/sim/economy.py::round_income, backend/tft/sim/economy.py::streak_gold, backend/tft/sim/economy.py::xp_to_next, backend/tft/sim/game.py::Game, backend/tft/sim/game.py::_delegate, backend/tft/sim/game.py::pair_players, backend/tft/sim/player.py::InvalidAction, backend/tft/sim/player.py::PlayerState, backend/tft/sim/player.py::buy, backend/tft/sim/player.py::buy_xp, backend/tft/sim/player.py::equip, backend/tft/sim/player.py::fill_board, backend/tft/sim/player.py::grab_carousel_unit, backend/tft/sim/player.py::grant_loot, backend/tft/sim/player.py::merge, backend/tft/sim/player.py::move, backend/tft/sim/player.py::new_player, backend/tft/sim/player.py::pick_augment, backend/tft/sim/player.py::refresh_shop, backend/tft/sim/player.py::reroll, backend/tft/sim/player.py::score, backend/tft/sim/player.py::sell, backend/tft/sim/player.py::unit_worth, backend/tft/sim/pool.py::Pool, backend/tft/sim/rounds.py::schedule, backend/tft/sim/shop.py::roll beziehungen: - nutzt: Modell und Artefakt - wird-genutzt-von: API-Schnittstelle