Files
Dreierpack-Manager/src/modern/game/training_camps.hpp
T
ClaudeandClaude Opus 5.5 6f55622307 Load Modern worlds and add Modern training camps (M3, M4)
M3 - Modern world loader:
- modern/content/world: typed view of the world tables (leagues, clubs,
  players, nations, league dates, training camp catalogue).
- modern/content/world_package: opens a Modern world (runtime:modern-v1, or
  editor:world-v1 until data revision 1.4), reads only the engine entries and
  decodes the Classic payload (import: load_classic_payload).
- modern/content/world_expand: turns the Classic start into the world: club
  ids in the order of the world's leagues, per-club tables remapped (added
  clubs copy an original club of their league), added players from their
  attributes, 24 squad slots per league club, pools kept, layout, league
  sizes and league dates installed; UTF-8 names and OBW ids in ModernState.
- Fixes found by playing the Modern data set: referee pool exhausted on days
  with German and larger international leagues (Modern deviation), card
  table per league club grown, slot-to-team lookup via WorldLayout, form
  history stride from the layout, remaining slot literals.
- Classic UI projections used by the session read the layout instead of
  executable constants (Classic values unchanged).
- modern_season_sim opens .obw worlds; MODERN_DEBUG / MODERN_WATCH tracing.

M4 - training camps:
- Catalogue in ModernState (built-in 18 fictional camps on three maps, or the
  world's extended catalogue); price, booking and effect use it.
- Six-star grades: step index capped, limit +1 from pitch 5 and +1 with pitch
  and fitness 6, catering 6 one more point of condition, lodging 6 one week
  less injury. Classic data behaves as before. modern_camp_tests.

Verified: 190 tests pass; Classic replay regression identical to the M0
baseline; season_sim and modern_season_sim identical with Classic data; the
Modern data set plays full seasons (leagues 34/38/34 rounds).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 22:43:25 +02:00

43 lines
1.5 KiB
C++

// SPDX-License-Identifier: GPL-3.0-only
#pragma once
// Training camp catalogue of the Modern season core (docs/new_engine/trainingslager.md, M4).
//
// Classic has eight resorts with four quality grades 1-5 read from the executable. Modern
// worlds list their camps in rule:training-camps: map (Germany, Europe, Middle East, ...),
// position on that map, place, country, base price and the four grades 0-6 (pitch, fitness,
// catering, lodging). A world without such a catalogue gets the built-in, fictional
// catalogue of 18 camps the Modern interface was designed with.
#include <array>
#include <cstdint>
#include <optional>
#include <string>
#include <vector>
namespace bmh::modern {
struct CampMap {
std::string id; // map:de, map:eu, map:me
std::string name;
std::optional<int> width, height; // coordinate system, once the interface defines it
};
struct TrainingCamp {
std::string id; // resort:<n>
std::string map; // CampMap id
std::optional<int> x, y; // position on the map, null until the interface sets it
std::string name, place, country;
int32_t base_price = 0; // the price is base_price + 5000 per squad player
std::array<uint8_t, 4> quality{}; // pitch, fitness, catering, lodging (0-6)
};
struct CampCatalogue {
std::vector<CampMap> maps;
std::vector<TrainingCamp> camps;
};
// The built-in catalogue: 18 fictional camps on three maps (Germany 6, Europe 9, Middle East 3).
const CampCatalogue& default_camp_catalogue();
} // namespace bmh::modern