Monopoly — Portage moderne 0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
AITradeIngress.hpp
Go to the documentation of this file.
1#pragma once
2
4#include "AIProfile.hpp"
5
6#include <array>
7#include <cstdint>
8
10{
12 {
14 // Retail Ai.h: AI_MAX_TRADES is 20, independent of configured maxTrades.
15 std::array<std::int64_t, 20> timeLastTrade{};
16 };
17
35
36 void resetTradeIngress(TradeIngressState& state) noexcept;
37
40 const actions::Message& message,
41 TradeIngressState& state) noexcept;
42
46 const TradeProposalList& proposal,
48 TradeIngressState& state) noexcept;
49
51 std::uint8_t numberOfPlayers,
53 const std::array<bool, rules::MaxPlayers>& localAIPlayers,
54 TradeIngressState& state) noexcept;
55
56 [[nodiscard]] std::array<double, rules::MaxPlayers> tradeResponseAttitudeChanges(
60 bool accepted,
61 const TradeIngressState& state,
63 const profile::ConfigContext& context) noexcept;
64
65 enum class TradeAcceptanceStatus : std::uint8_t
66 {
67 InvalidInput = 0,
69 Busy,
70 Accept,
75 };
76
84
91
92 [[nodiscard]] TradeAcceptanceResult evaluateCurrentTradeAcceptance(
95 const TradeAcceptanceConfig& config,
96 const TradeIngressState& state) noexcept;
97
98 [[nodiscard]] CounterTradeRunResult counterProposeCurrentTrade(
100 rules::PlayerNumber player,
101 bool tradeAccept,
102 double counterRoll,
103 int pendingActions,
104 bool auctionOn,
107 TradeIngressState& state) noexcept;
108}
unsigned state
unsigned index
std::array< Profile, rules::MaxPlayers > ProfileSet
Definition AIProfile.hpp:78
void resetTradeIngress(TradeIngressState &state) noexcept
std::array< double, rules::MaxPlayers > tradeResponseAttitudeChanges(const rules::GameState &gameState, rules::PlayerNumber proposer, rules::PlayerNumber respondingPlayer, bool accepted, const TradeIngressState &state, const profile::ProfileSet &profiles, const profile::ConfigContext &context) noexcept
std::array< FutureImmunityRecord, rules::MaxCountHitSets > FutureImmunityList
bool sendProactiveTrade(const rules::GameState &gameState, rules::PlayerNumber player, const TradeProposalList &proposal, const profile::Profile &strategy, TradeIngressState &state) noexcept
void advanceTradeTurn(std::uint8_t numberOfPlayers, profile::ProfileSet &profiles, const std::array< bool, rules::MaxPlayers > &localAIPlayers, TradeIngressState &state) noexcept
CounterTradeRunResult counterProposeCurrentTrade(const rules::GameState &gameState, rules::PlayerNumber player, bool tradeAccept, double counterRoll, int pendingActions, bool auctionOn, const decision::CounterProposalPreflightConfig &preflightConfig, const decision::CounterProposalBalanceConfig &balanceConfig, TradeIngressState &state) noexcept
std::array< TradeProposalRecord, rules::MaxPlayers > TradeProposalList
TradeAcceptanceResult evaluateCurrentTradeAcceptance(const rules::GameState &gameState, rules::PlayerNumber player, const TradeAcceptanceConfig &config, const TradeIngressState &state) noexcept
bool processTradeRuleMessage(const rules::GameState &gameState, const actions::Message &message, TradeIngressState &state) noexcept
std::uint8_t PlayerNumber
Definition RuleTypes.hpp:12
constexpr PlayerNumber MaxPlayers
Definition RuleTypes.hpp:14
constexpr PlayerNumber NobodyPlayer
Definition RuleTypes.hpp:16
decision::TradeEvaluationConfig evaluation
CounterTradeRuntimeState counterRuntime
std::array< TradeTurnState, rules::MaxPlayers > turnState
std::array< decision::CounterProposalSession, rules::MaxPlayers > counterSessions
std::array< std::int64_t, 20 > timeLastTrade