Monopoly — Portage moderne 0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
BoardRules.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "RuleTypes.hpp"
4
5#include <array>
6#include <cstddef>
7#include <cstdint>
8
10{
58
59 static_assert(
60 static_cast<std::size_t>(SquareType::Count) == 42
61 );
62
63
64 enum class SquareGroup : std::uint8_t
65 {
75 Utility,
76
77 // SG_MAX_PROPERTY_GROUPS = 10
79 Chance,
81
82 Count
83 };
84
85 inline constexpr std::size_t MaxPropertyGroups = 10;
86 inline constexpr std::size_t RentStepCount = 6;
87
88 using PropertySet = std::uint32_t;
89
90
92 {
93 std::int64_t purchaseCost = 0;
94 std::int64_t mortgageCost = 0;
95
96 std::array<std::int64_t, RentStepCount> rent{};
97
98 std::int64_t housePurchaseCost = 0;
99
102 };
103
104
106 const GameOptions& options
107 );
108
109 const std::array<SquareDefinition, 42>&
110 definitions();
111
112 const SquareDefinition&
113 definition(SquareType square);
114
115 // Printed deeds use canonical rents: UDPENNY_CreateDeed compensated the
116 // short-game table swap, so their values are independent of active rules.
117 const SquareDefinition&
119
121 SquareType square
122 );
123
124 bool isOwnable(
125 SquareType square
126 );
127}
const SquareDefinition & definition(SquareType square)
bool isOwnable(SquareType square)
const SquareDefinition & originalDefinition(SquareType square)
constexpr std::size_t RentStepCount
bool initializeForOptions(const GameOptions &options)
constexpr std::size_t MaxPropertyGroups
std::uint32_t PropertySet
PropertySet propertyBit(SquareType square)
const std::array< SquareDefinition, 42 > & definitions()
std::array< std::int64_t, RentStepCount > rent