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

Classes

struct  Command
 
struct  Rect
 
struct  State
 

Enumerations

enum class  Phase : std::uint8_t {
  None = 0 , HiScore , LocalOrNetwork , SelectPlayer ,
  EnterName , SelectToken , StartAddRemove , RemovePlayer ,
  SelectAIStrength , SelectCity , StandardOrCustomRules , CustomizeRules ,
  Max
}
 
enum class  Button : std::uint8_t {
  None = 0 , EnterNameNext , SelectPlayerNew , SelectPlayerMore ,
  SelectPlayerCard1 , SelectPlayerCard2 , SelectPlayerCard3 , SelectPlayerCard4 ,
  SelectPlayerCard5 , SelectPlayerCard6 , SelectPlayerCard7 , SelectPlayerCard8 ,
  TokenGun , TokenIron , TokenThimble , TokenCar ,
  TokenHorse , TokenBarrow , TokenDog , TokenShip ,
  TokenMoneyBag , TokenHat , TokenShoe , TokenNext ,
  AddHuman , AddComputer , RemovePlayer , StartGame ,
  RemoveCancel , AIEasy , AIMedium , AIHard ,
  CityClassic , CityLoadBoard , CityLeft , CityRight ,
  CountryLeft , CountryRight , CurrencyLeft , CurrencyRight ,
  CityNext , RulesStandard , RulesCustom , RulesOkay ,
  RulesRestoreStandard , RulesShortGame
}
 
enum class  CommandType : std::uint8_t {
  None = 0 , AddLocalPlayer , RemoveLocalPlayer , StartGame ,
  CommitCity , RequestCustomBoard , AcceptStandardRules , AcceptCustomRules ,
  RestoreStandardRules , ApplyShortGameRules , ApplyCustomRule
}
 

Functions

void initialize (State &state, bool serverMode)
 
void setTokenName (State &state, std::uint8_t token, std::wstring_view name)
 
void setPlayerLogAvailable (State &state, bool available)
 
void setPlayerLogEntries (State &state, const rules::GameState &uiState, std::span< const std::wstring > entries)
 
void setEnteredName (State &state, std::wstring_view name)
 
void requestPhase (State &state, const GameState &uiState, Phase requested)
 
bool tokenAvailable (const GameState &uiState, std::uint8_t token)
 
std::uint8_t nextAvailableToken (const GameState &uiState, std::uint8_t currentToken)
 
std::uint8_t tokenFromName (const State &state, const GameState &uiState, std::wstring_view name)
 
std::uint8_t nextAvailableColour (const GameState &uiState, std::uint8_t currentColour)
 
Button buttonAt (Phase phase, int x, int y, data::BoardEdition edition)
 
Command clickButton (State &state, const GameState &uiState, Button button)
 
Command clickAt (State &state, const GameState &uiState, int x, int y)
 
Command customRuleChoice (State &state, const GameState &, rules::options::SetupRule rule, std::uint8_t choice)
 
Command playerBarClicked (State &state, rules::PlayerNumber player)
 
void requestPhase (State &state, const rules::GameState &uiState, Phase phase)
 
bool tokenAvailable (const rules::GameState &uiState, std::uint8_t token)
 
std::uint8_t nextAvailableToken (const rules::GameState &uiState, std::uint8_t currentToken)
 
std::uint8_t tokenFromName (const State &state, const rules::GameState &uiState, std::wstring_view name)
 
std::uint8_t nextAvailableColour (const rules::GameState &uiState, std::uint8_t currentColour)
 
Command clickButton (State &state, const rules::GameState &uiState, Button button)
 
Command clickAt (State &state, const rules::GameState &uiState, int x, int y)
 
Command customRuleChoice (State &state, const rules::GameState &uiState, rules::options::SetupRule rule, std::uint8_t choice)
 

Variables

constexpr std::size_t PlayerHistoryMaximumEntries = 100
 
constexpr std::size_t PlayerHistoryPageSize = 8
 
constexpr std::size_t MaximumEnteredNameLength = 10
 
constexpr int MonetarySystemEuro = 12
 
constexpr int MonetarySystemUs = 13
 
constexpr std::uint8_t TokenGun = 0
 
constexpr std::uint8_t TokenCar = 1
 
constexpr std::uint8_t TokenDog = 2
 
constexpr std::uint8_t TokenHat = 3
 
constexpr std::uint8_t TokenIron = 4
 
constexpr std::uint8_t TokenHorse = 5
 
constexpr std::uint8_t TokenShip = 6
 
constexpr std::uint8_t TokenShoe = 7
 
constexpr std::uint8_t TokenThimble = 8
 
constexpr std::uint8_t TokenBarrow = 9
 
constexpr std::uint8_t TokenMoneyBag = 10
 

Enumeration Type Documentation

◆ Button

enum class monopoly::ui::playersetup::Button : std::uint8_t
strong
Enumerator
None 
EnterNameNext 
SelectPlayerNew 
SelectPlayerMore 
SelectPlayerCard1 
SelectPlayerCard2 
SelectPlayerCard3 
SelectPlayerCard4 
SelectPlayerCard5 
SelectPlayerCard6 
SelectPlayerCard7 
SelectPlayerCard8 
TokenGun 
TokenIron 
TokenThimble 
TokenCar 
TokenHorse 
TokenBarrow 
TokenDog 
TokenShip 
TokenMoneyBag 
TokenHat 
TokenShoe 
TokenNext 
AddHuman 
AddComputer 
RemovePlayer 
StartGame 
RemoveCancel 
AIEasy 
AIMedium 
AIHard 
CityClassic 
CityLoadBoard 
CityLeft 
CityRight 
CountryLeft 
CountryRight 
CurrencyLeft 
CurrencyRight 
CityNext 
RulesStandard 
RulesCustom 
RulesOkay 
RulesRestoreStandard 
RulesShortGame 

Definition at line 35 of file PlayerSetupFlow.hpp.

◆ CommandType

enum class monopoly::ui::playersetup::CommandType : std::uint8_t
strong
Enumerator
None 
AddLocalPlayer 
RemoveLocalPlayer 
StartGame 
CommitCity 
RequestCustomBoard 
AcceptStandardRules 
AcceptCustomRules 
RestoreStandardRules 
ApplyShortGameRules 
ApplyCustomRule 

Definition at line 122 of file PlayerSetupFlow.hpp.

◆ Phase

enum class monopoly::ui::playersetup::Phase : std::uint8_t
strong
Enumerator
None 
HiScore 
LocalOrNetwork 
SelectPlayer 
EnterName 
SelectToken 
StartAddRemove 
RemovePlayer 
SelectAIStrength 
SelectCity 
StandardOrCustomRules 
CustomizeRules 
Max 

Definition at line 17 of file PlayerSetupFlow.hpp.

Function Documentation

◆ buttonAt()

Button monopoly::ui::playersetup::buttonAt ( Phase  phase,
int  x,
int  y,
data::BoardEdition  edition 
)

Definition at line 777 of file PlayerSetupFlow.cpp.

◆ clickAt() [1/2]

Command monopoly::ui::playersetup::clickAt ( State &  state,
const GameState &  uiState,
int  x,
int  y 
)

Definition at line 1391 of file PlayerSetupFlow.cpp.

◆ clickAt() [2/2]

Command monopoly::ui::playersetup::clickAt ( State &  state,
const rules::GameState &  uiState,
int  x,
int  y 
)

◆ clickButton() [1/2]

Command monopoly::ui::playersetup::clickButton ( State &  state,
const GameState &  uiState,
Button  button 
)

Definition at line 932 of file PlayerSetupFlow.cpp.

◆ clickButton() [2/2]

Command monopoly::ui::playersetup::clickButton ( State &  state,
const rules::GameState &  uiState,
Button  button 
)

◆ customRuleChoice() [1/2]

Command monopoly::ui::playersetup::customRuleChoice ( State &  state,
const GameState &  ,
rules::options::SetupRule  rule,
std::uint8_t  choice 
)

Definition at line 1411 of file PlayerSetupFlow.cpp.

◆ customRuleChoice() [2/2]

Command monopoly::ui::playersetup::customRuleChoice ( State &  state,
const rules::GameState &  uiState,
rules::options::SetupRule  rule,
std::uint8_t  choice 
)

◆ initialize()

void monopoly::ui::playersetup::initialize ( State &  state,
bool  serverMode 
)

Definition at line 427 of file PlayerSetupFlow.cpp.

◆ nextAvailableColour() [1/2]

std::uint8_t monopoly::ui::playersetup::nextAvailableColour ( const GameState &  uiState,
std::uint8_t  currentColour 
)

Definition at line 711 of file PlayerSetupFlow.cpp.

◆ nextAvailableColour() [2/2]

std::uint8_t monopoly::ui::playersetup::nextAvailableColour ( const rules::GameState &  uiState,
std::uint8_t  currentColour 
)

◆ nextAvailableToken() [1/2]

std::uint8_t monopoly::ui::playersetup::nextAvailableToken ( const GameState &  uiState,
std::uint8_t  currentToken 
)

Definition at line 622 of file PlayerSetupFlow.cpp.

◆ nextAvailableToken() [2/2]

std::uint8_t monopoly::ui::playersetup::nextAvailableToken ( const rules::GameState &  uiState,
std::uint8_t  currentToken 
)

◆ playerBarClicked()

Command monopoly::ui::playersetup::playerBarClicked ( State &  state,
rules::PlayerNumber  player 
)

Definition at line 1432 of file PlayerSetupFlow.cpp.

◆ requestPhase() [1/2]

void monopoly::ui::playersetup::requestPhase ( State &  state,
const GameState &  uiState,
Phase  requested 
)

Definition at line 547 of file PlayerSetupFlow.cpp.

◆ requestPhase() [2/2]

void monopoly::ui::playersetup::requestPhase ( State &  state,
const rules::GameState &  uiState,
Phase  phase 
)

◆ setEnteredName()

void monopoly::ui::playersetup::setEnteredName ( State &  state,
std::wstring_view  name 
)

Definition at line 525 of file PlayerSetupFlow.cpp.

◆ setPlayerLogAvailable()

void monopoly::ui::playersetup::setPlayerLogAvailable ( State &  state,
bool  available 
)

Definition at line 469 of file PlayerSetupFlow.cpp.

◆ setPlayerLogEntries()

void monopoly::ui::playersetup::setPlayerLogEntries ( State &  state,
const rules::GameState &  uiState,
std::span< const std::wstring >  entries 
)

Definition at line 484 of file PlayerSetupFlow.cpp.

◆ setTokenName()

void monopoly::ui::playersetup::setTokenName ( State &  state,
std::uint8_t  token,
std::wstring_view  name 
)

Definition at line 452 of file PlayerSetupFlow.cpp.

◆ tokenAvailable() [1/2]

bool monopoly::ui::playersetup::tokenAvailable ( const GameState &  uiState,
std::uint8_t  token 
)

Definition at line 600 of file PlayerSetupFlow.cpp.

◆ tokenAvailable() [2/2]

bool monopoly::ui::playersetup::tokenAvailable ( const rules::GameState &  uiState,
std::uint8_t  token 
)

◆ tokenFromName() [1/2]

std::uint8_t monopoly::ui::playersetup::tokenFromName ( const State &  state,
const GameState &  uiState,
std::wstring_view  name 
)

Definition at line 682 of file PlayerSetupFlow.cpp.

◆ tokenFromName() [2/2]

std::uint8_t monopoly::ui::playersetup::tokenFromName ( const State &  state,
const rules::GameState &  uiState,
std::wstring_view  name 
)

Variable Documentation

◆ MaximumEnteredNameLength

constexpr std::size_t monopoly::ui::playersetup::MaximumEnteredNameLength = 10
inlineconstexpr

Definition at line 228 of file PlayerSetupFlow.hpp.

◆ MonetarySystemEuro

constexpr int monopoly::ui::playersetup::MonetarySystemEuro = 12
inlineconstexpr

Definition at line 230 of file PlayerSetupFlow.hpp.

◆ MonetarySystemUs

constexpr int monopoly::ui::playersetup::MonetarySystemUs = 13
inlineconstexpr

Definition at line 231 of file PlayerSetupFlow.hpp.

◆ PlayerHistoryMaximumEntries

constexpr std::size_t monopoly::ui::playersetup::PlayerHistoryMaximumEntries = 100
inlineconstexpr

Definition at line 168 of file PlayerSetupFlow.hpp.

◆ PlayerHistoryPageSize

constexpr std::size_t monopoly::ui::playersetup::PlayerHistoryPageSize = 8
inlineconstexpr

Definition at line 169 of file PlayerSetupFlow.hpp.

◆ TokenBarrow

constexpr std::uint8_t monopoly::ui::playersetup::TokenBarrow = 9
inlineconstexpr

Definition at line 244 of file PlayerSetupFlow.hpp.

◆ TokenCar

constexpr std::uint8_t monopoly::ui::playersetup::TokenCar = 1
inlineconstexpr

Definition at line 236 of file PlayerSetupFlow.hpp.

◆ TokenDog

constexpr std::uint8_t monopoly::ui::playersetup::TokenDog = 2
inlineconstexpr

Definition at line 237 of file PlayerSetupFlow.hpp.

◆ TokenGun

constexpr std::uint8_t monopoly::ui::playersetup::TokenGun = 0
inlineconstexpr

Definition at line 235 of file PlayerSetupFlow.hpp.

◆ TokenHat

constexpr std::uint8_t monopoly::ui::playersetup::TokenHat = 3
inlineconstexpr

Definition at line 238 of file PlayerSetupFlow.hpp.

◆ TokenHorse

constexpr std::uint8_t monopoly::ui::playersetup::TokenHorse = 5
inlineconstexpr

Definition at line 240 of file PlayerSetupFlow.hpp.

◆ TokenIron

constexpr std::uint8_t monopoly::ui::playersetup::TokenIron = 4
inlineconstexpr

Definition at line 239 of file PlayerSetupFlow.hpp.

◆ TokenMoneyBag

constexpr std::uint8_t monopoly::ui::playersetup::TokenMoneyBag = 10
inlineconstexpr

Definition at line 245 of file PlayerSetupFlow.hpp.

◆ TokenShip

constexpr std::uint8_t monopoly::ui::playersetup::TokenShip = 6
inlineconstexpr

Definition at line 241 of file PlayerSetupFlow.hpp.

◆ TokenShoe

constexpr std::uint8_t monopoly::ui::playersetup::TokenShoe = 7
inlineconstexpr

Definition at line 242 of file PlayerSetupFlow.hpp.

◆ TokenThimble

constexpr std::uint8_t monopoly::ui::playersetup::TokenThimble = 8
inlineconstexpr

Definition at line 243 of file PlayerSetupFlow.hpp.