Monopoly — Portage moderne 0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
monopoly::ai::profile Namespace Reference

Classes

struct  ConfigContext
 
struct  Error
 
struct  Profile
 
struct  RuntimeState
 

Typedefs

using ProfileSet = std::array< Profile, rules::MaxPlayers >
 

Enumerations

enum class  ErrorCode : std::uint8_t {
  InvalidLevel = 0 , IoError , MalformedValue , InvalidEnum ,
  UnknownAttribute
}
 

Functions

std::expected< Profile, Error > parse (std::string_view text, int level)
 
std::expected< Profile, Error > load (const std::filesystem::path &path, int level)
 
std::string_view tokenFileName (std::uint8_t token) noexcept
 
decision::TradeEvaluationConfig makeTradeEvaluationConfig (const ProfileSet &profiles, rules::PlayerNumber strategyPlayer, const ConfigContext &context) noexcept
 
decision::CounterProposalPreflightConfig makeCounterPreflightConfig (const ProfileSet &profiles, rules::PlayerNumber strategyPlayer, const ConfigContext &context) noexcept
 
decision::CounterProposalBalanceConfig makeCounterBalanceConfig (const ProfileSet &profiles, rules::PlayerNumber strategyPlayer, const ConfigContext &context) noexcept
 
decision::MonopolyProposalConfig makeMonopolyProposalConfig (const ProfileSet &profiles, rules::PlayerNumber strategyPlayer, const ConfigContext &context) noexcept
 
void resetRuntime (RuntimeState &state) noexcept
 
std::expected< void, Error > initializeRuntime (RuntimeState &state, const std::filesystem::path &directory)
 
std::expected< void, Error > loadPlayerRuntime (RuntimeState &state, rules::PlayerNumber player, std::uint8_t token, std::uint8_t level)
 
void clearPlayerRuntime (RuntimeState &state, rules::PlayerNumber player) noexcept
 
const Profile * playerRuntimeProfile (const RuntimeState &state, rules::PlayerNumber player) noexcept
 
const Profile * expertRuntimeProfile (const RuntimeState &state) noexcept
 

Variables

constexpr std::size_t TokenProfileCount = 11
 

Typedef Documentation

◆ ProfileSet

Enumeration Type Documentation

◆ ErrorCode

enum class monopoly::ai::profile::ErrorCode : std::uint8_t
strong
Enumerator
InvalidLevel 
IoError 
MalformedValue 
InvalidEnum 
UnknownAttribute 

Definition at line 14 of file AIProfile.hpp.

Function Documentation

◆ clearPlayerRuntime()

void monopoly::ai::profile::clearPlayerRuntime ( RuntimeState &  state,
rules::PlayerNumber  player 
)
noexcept

Definition at line 84 of file AIProfileRuntime.cpp.

◆ expertRuntimeProfile()

const Profile * monopoly::ai::profile::expertRuntimeProfile ( const RuntimeState &  state)
noexcept

Definition at line 105 of file AIProfileRuntime.cpp.

◆ initializeRuntime()

std::expected< void, Error > monopoly::ai::profile::initializeRuntime ( RuntimeState &  state,
const std::filesystem::path &  directory 
)

Definition at line 12 of file AIProfileRuntime.cpp.

◆ load()

std::expected< Profile, Error > monopoly::ai::profile::load ( const std::filesystem::path &  path,
int  level 
)

Definition at line 321 of file AIProfile.cpp.

◆ loadPlayerRuntime()

std::expected< void, Error > monopoly::ai::profile::loadPlayerRuntime ( RuntimeState &  state,
rules::PlayerNumber  player,
std::uint8_t  token,
std::uint8_t  level 
)

Definition at line 28 of file AIProfileRuntime.cpp.

◆ makeCounterBalanceConfig()

decision::CounterProposalBalanceConfig monopoly::ai::profile::makeCounterBalanceConfig ( const ProfileSet &  profiles,
rules::PlayerNumber  strategyPlayer,
const ConfigContext &  context 
)
noexcept

Definition at line 391 of file AIProfile.cpp.

◆ makeCounterPreflightConfig()

decision::CounterProposalPreflightConfig monopoly::ai::profile::makeCounterPreflightConfig ( const ProfileSet &  profiles,
rules::PlayerNumber  strategyPlayer,
const ConfigContext &  context 
)
noexcept

Definition at line 374 of file AIProfile.cpp.

◆ makeMonopolyProposalConfig()

decision::MonopolyProposalConfig monopoly::ai::profile::makeMonopolyProposalConfig ( const ProfileSet &  profiles,
rules::PlayerNumber  strategyPlayer,
const ConfigContext &  context 
)
noexcept

Definition at line 413 of file AIProfile.cpp.

◆ makeTradeEvaluationConfig()

decision::TradeEvaluationConfig monopoly::ai::profile::makeTradeEvaluationConfig ( const ProfileSet &  profiles,
rules::PlayerNumber  strategyPlayer,
const ConfigContext &  context 
)
noexcept

Definition at line 341 of file AIProfile.cpp.

◆ parse()

std::expected< Profile, Error > monopoly::ai::profile::parse ( std::string_view  text,
int  level 
)

Definition at line 278 of file AIProfile.cpp.

◆ playerRuntimeProfile()

const Profile * monopoly::ai::profile::playerRuntimeProfile ( const RuntimeState &  state,
rules::PlayerNumber  player 
)
noexcept

Definition at line 96 of file AIProfileRuntime.cpp.

◆ resetRuntime()

void monopoly::ai::profile::resetRuntime ( RuntimeState &  state)
noexcept

Definition at line 7 of file AIProfileRuntime.cpp.

◆ tokenFileName()

std::string_view monopoly::ai::profile::tokenFileName ( std::uint8_t  token)
noexcept

Definition at line 333 of file AIProfile.cpp.

Variable Documentation

◆ TokenProfileCount

constexpr std::size_t monopoly::ai::profile::TokenProfileCount = 11
inlineconstexpr

Definition at line 77 of file AIProfile.hpp.