|
Player12
An open source football management simulator
|
Pure decision rules of the transfer market. More...
Classes | |
| struct | ClubResponse |
| struct | ContractDemand |
| struct | ContractOffer |
| struct | ContractResponse |
| struct | LoanContext |
| struct | LoanTerms |
| struct | OfferTerms |
| A club-to-club offer: fee, instalments, add-ons and sell-on. More... | |
| struct | PlayerContext |
| struct | PositionNeed |
| struct | SaleContext |
| struct | SquadFit |
| struct | SquadNeeds |
| struct | Valuation |
| struct | WindowInfo |
Enumerations | |
| enum class | Reason : std::uint8_t { KeyPlayer , FirstTeamPlayer , SellingToRival , MidSeason , LateWindow , RicherBuyer , Listed , NotForSale , ReleaseClauseMet , OfferTooLow , TooLittleUpfront , CounterOffer , TalksBroken , OfferAccepted , LongContract , ExpiringContract , OpeningBidLow , KeyPlayerNotForSale , WageTooLow , ContractTooShort , ContractTooLong , ClubTooSmall , PlayingTime , PromiseNotCredible , WantsReleaseClause , LoyalToClub , BiggerClub , TermsAccepted , TalksEnded , AgentPushback , NotForLoan , WageShareTooLow , OptionTooLow , LoanLimit , NoPlayingTimeOnLoan , WindowClosed , Unavailable , OverBudget , Embargo , AgentFeeTooLow , SquadFull , COUNT } |
| enum class | ContractKind : std::uint8_t { Transfer , FreeAgent , PreContract , Renewal } |
| enum class | LoanDuration : std::uint8_t { SeasonEnd , SixMonths } |
| enum class | FitKind : std::uint8_t { None , Starter , Upgrade , Depth } |
Functions | |
| const char * | reasonKey (Reason reason) |
| bool | isValid (const OfferTerms &terms) |
| std::uint32_t | upfrontAmount (const OfferTerms &terms) |
| std::vector< std::uint32_t > | instalmentAmounts (const OfferTerms &terms) |
| OfferTerms | aiOfferTerms (std::uint32_t fee) |
| OfferTerms | aiBidFor (std::uint32_t asking_fee, int age) |
| Valuation | valueForSale (const SaleContext &context) |
| double | sellerValue (const OfferTerms &terms, int age) |
| ClubResponse | evaluateOffer (const SaleContext &context, const OfferTerms &terms, std::uint8_t round) |
| std::uint8_t | maxContractYears (int age) |
| ContractDemand | contractDemand (const PlayerContext &context) |
| std::uint32_t | agentAsk (const PlayerContext &context, const ContractDemand &demand, std::uint8_t round) |
| ContractResponse | evaluateContract (const PlayerContext &context, const ContractOffer &offer, std::uint8_t round) |
| float | appearanceRate (SquadRole role) |
| double | yearlyRiseWorth (std::uint32_t wage, std::uint8_t percent, std::uint8_t years) |
| ContractOffer | demandedOffer (const ContractDemand &demand) |
| ClubResponse | evaluateLoan (const LoanContext &context, const LoanTerms &terms) |
| bool | playerAcceptsLoan (SquadRole at_parent, SquadRole at_borrower, std::uint8_t ambition, int reputation_gap, std::vector< Reason > &reasons) |
| WindowInfo | windowInfo (LeagueID league, const GameDateValue &date) |
| float | activityWeight (const WindowInfo &window) |
| bool | canSignPreContract (std::uint8_t contract_years, const GameDateValue &date) |
| GameDateValue | seasonEndDate (const GameDateValue &date) |
| GameDateValue | contractEndDate (const GameDateValue &date, std::uint8_t contract_years) |
| GameDateValue | loanEndDate (const GameDateValue &start, LoanDuration duration) |
| int | weeksBetween (const GameDateValue &from, const GameDateValue &to) |
| std::int64_t | severancePay (std::uint32_t weekly_wage, std::uint8_t contract_years, const GameDateValue &date) |
| SquadRole | roleForRank (std::size_t rank) |
| PlayerRole | positionGroup (PlayerRole role) |
| SquadNeeds | squadNeeds (std::span< const std::pair< PlayerRole, float > > squad) |
| SquadFit | squadFit (const SquadNeeds &needs, PlayerRole role, float overall) |
Pure decision rules of the transfer market.
Club valuations, the seller's reading of a structured offer, the player's contract demands and answers, loan terms and window timing. Nothing here touches the game state, so every rule is unit-testable and deterministic.
|
strong |
|
strong |
|
strong |
|
strong |
Why a club or player answered the way they did (language keys).
| float TransferNegotiation::activityWeight | ( | const WindowInfo & | window | ) |
Relative AI activity: rises in the last week, spikes on deadline day.
| std::uint32_t TransferNegotiation::agentAsk | ( | const PlayerContext & | context, |
| const ContractDemand & | demand, | ||
| std::uint8_t | round | ||
| ) |
Wage the agent asks for after round rejected proposals: above the real demand by a margin that grows with ambition and with the step down in club stature, falling to the demand itself by the last round.
| OfferTerms TransferNegotiation::aiBidFor | ( | std::uint32_t | asking_fee, |
| int | age | ||
| ) |
An AI club's bid for a player the seller values at asking_fee: the AI structure (instalments above AI_INSTALMENT_THRESHOLD) with the headline fee raised until the seller's valuation of the deferred money reaches the asking fee, so large deals between computer-managed clubs can complete.
| OfferTerms TransferNegotiation::aiOfferTerms | ( | std::uint32_t | fee | ) |
Structure used by AI clubs: big fees are spread over instalments.
| float TransferNegotiation::appearanceRate | ( | SquadRole | role | ) |
Competitive appearances per week of a player in role.
| bool TransferNegotiation::canSignPreContract | ( | std::uint8_t | contract_years, |
| const GameDateValue & | date | ||
| ) |
Players in the final six months (from 1 January) may pre-sign.
| ContractDemand TransferNegotiation::contractDemand | ( | const PlayerContext & | context | ) |
Demands for talks that have not started (asking_wage = opening ask).
| GameDateValue TransferNegotiation::contractEndDate | ( | const GameDateValue & | date, |
| std::uint8_t | contract_years | ||
| ) |
Last day of a contract with contract_years seasons left on date (years are counted down on 1 July).
| ContractOffer TransferNegotiation::demandedOffer | ( | const ContractDemand & | demand | ) |
Contract that exactly meets the demands (used by AI clubs).
| ContractResponse TransferNegotiation::evaluateContract | ( | const PlayerContext & | context, |
| const ContractOffer & | offer, | ||
| std::uint8_t | round | ||
| ) |
round counts proposals already rejected in these talks.
| ClubResponse TransferNegotiation::evaluateLoan | ( | const LoanContext & | context, |
| const LoanTerms & | terms | ||
| ) |
| ClubResponse TransferNegotiation::evaluateOffer | ( | const SaleContext & | context, |
| const OfferTerms & | terms, | ||
| std::uint8_t | round | ||
| ) |
Evaluates a transfer offer. round counts offers already made in these talks (0 = first offer).
| std::vector< std::uint32_t > TransferNegotiation::instalmentAmounts | ( | const OfferTerms & | terms | ) |
Yearly instalments (sum = fee - upfront).
| bool TransferNegotiation::isValid | ( | const OfferTerms & | terms | ) |
True when the structure is internally consistent.
| GameDateValue TransferNegotiation::loanEndDate | ( | const GameDateValue & | start, |
| LoanDuration | duration | ||
| ) |
Last day of a loan starting on start (clipped to 30 June).
| std::uint8_t TransferNegotiation::maxContractYears | ( | int | age | ) |
Longest contract allowed at age (RSTP).
| bool TransferNegotiation::playerAcceptsLoan | ( | SquadRole | at_parent, |
| SquadRole | at_borrower, | ||
| std::uint8_t | ambition, | ||
| int | reputation_gap, | ||
| std::vector< Reason > & | reasons | ||
| ) |
True when the player agrees to the loan; otherwise reasons says why.
| PlayerRole TransferNegotiation::positionGroup | ( | PlayerRole | role | ) |
Position group for squad planning: central midfielders (CDM, CM, CAM) and wide players (LM, RM, LW, RW) are interchangeable.
| const char * TransferNegotiation::reasonKey | ( | Reason | reason | ) |
Language key describing reason (e.g. "NEG_REASON_KEY_PLAYER").
| SquadRole TransferNegotiation::roleForRank | ( | std::size_t | rank | ) |
Playing-time role for a 0-based ability rank (as the world sim).
| GameDateValue TransferNegotiation::seasonEndDate | ( | const GameDateValue & | date | ) |
30 June closing the season that contains date.
| double TransferNegotiation::sellerValue | ( | const OfferTerms & | terms, |
| int | age | ||
| ) |
Seller's present value of an offer (deferred money discounted, add-ons and sell-on credited with caps).
| std::int64_t TransferNegotiation::severancePay | ( | std::uint32_t | weekly_wage, |
| std::uint8_t | contract_years, | ||
| const GameDateValue & | date | ||
| ) |
Remaining contract wages owed to a released player.
| SquadFit TransferNegotiation::squadFit | ( | const SquadNeeds & | needs, |
| PlayerRole | role, | ||
| float | overall | ||
| ) |
| SquadNeeds TransferNegotiation::squadNeeds | ( | std::span< const std::pair< PlayerRole, float > > | squad | ) |
Needs of a squad given each player's role and overall.
| std::uint32_t TransferNegotiation::upfrontAmount | ( | const OfferTerms & | terms | ) |
Amount paid on signing.
| Valuation TransferNegotiation::valueForSale | ( | const SaleContext & | context | ) |
| int TransferNegotiation::weeksBetween | ( | const GameDateValue & | from, |
| const GameDateValue & | to | ||
| ) |
Whole weeks from from to to (0 if not after).
| WindowInfo TransferNegotiation::windowInfo | ( | LeagueID | league, |
| const GameDateValue & | date | ||
| ) |
Window of clubs of league on date (TransferWindows).
| double TransferNegotiation::yearlyRiseWorth | ( | std::uint32_t | wage, |
| std::uint8_t | percent, | ||
| std::uint8_t | years | ||
| ) |
Weekly worth of a yearly rise of percent over years on wage (the average uplift over the contract).