monopolpy_companion 1.0.dev41__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. monopolpy_companion-1.0.dev41/PKG-INFO +204 -0
  2. monopolpy_companion-1.0.dev41/README.md +180 -0
  3. monopolpy_companion-1.0.dev41/monopolpy_companion/__init__.py +62 -0
  4. monopolpy_companion-1.0.dev41/monopolpy_companion/cli.py +75 -0
  5. monopolpy_companion-1.0.dev41/monopolpy_companion/conf/conf.py +13 -0
  6. monopolpy_companion-1.0.dev41/monopolpy_companion/conf/default.ini +10 -0
  7. monopolpy_companion-1.0.dev41/monopolpy_companion/conf/default.yml +3 -0
  8. monopolpy_companion-1.0.dev41/monopolpy_companion/controller.py +396 -0
  9. monopolpy_companion-1.0.dev41/monopolpy_companion/game/__init__.py +24 -0
  10. monopolpy_companion-1.0.dev41/monopolpy_companion/game/accounts.py +93 -0
  11. monopolpy_companion-1.0.dev41/monopolpy_companion/game/board.py +48 -0
  12. monopolpy_companion-1.0.dev41/monopolpy_companion/game/engine.py +1199 -0
  13. monopolpy_companion-1.0.dev41/monopolpy_companion/game/events.py +24 -0
  14. monopolpy_companion-1.0.dev41/monopolpy_companion/game/finance.py +99 -0
  15. monopolpy_companion-1.0.dev41/monopolpy_companion/game/logging.py +25 -0
  16. monopolpy_companion-1.0.dev41/monopolpy_companion/game/models.py +410 -0
  17. monopolpy_companion-1.0.dev41/monopolpy_companion/game/repository.py +76 -0
  18. monopolpy_companion-1.0.dev41/monopolpy_companion/game/security.py +70 -0
  19. monopolpy_companion-1.0.dev41/monopolpy_companion/game/statistics.py +190 -0
  20. monopolpy_companion-1.0.dev41/monopolpy_companion/game/storage.py +51 -0
  21. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/__init__.py +0 -0
  22. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/common/error.py +1 -0
  23. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/common/paths.py +17 -0
  24. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/common/player_man.py +11 -0
  25. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/common/run.py +66 -0
  26. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/common/settings.py +65 -0
  27. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/common/state.py +28 -0
  28. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/common/utilities/db_man.py +28 -0
  29. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/fonts/MONOPOLY_INLINE.ttf +0 -0
  30. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/fonts/Monopoly Regular.ttf +0 -0
  31. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/gui/__init__.py +7 -0
  32. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/gui/models/__init__.py +0 -0
  33. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/gui/models/images/buttons/app_win.py +16 -0
  34. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/gui/models/images/icons/main_default.py +13 -0
  35. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/gui/models/images/monopolpy_man16.png +0 -0
  36. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/gui/models/images/monopolpy_man32.png +0 -0
  37. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/gui/models/images/sys_tray.py +15 -0
  38. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/gui/models/menus/top_menu.py +5 -0
  39. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/gui/models/popups/alerts.py +17 -0
  40. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/gui/models/windows/__init__.py +4 -0
  41. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/gui/models/windows/application.py +124 -0
  42. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/gui/models/windows/options.py +94 -0
  43. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/gui/models/windows/player_man.py +78 -0
  44. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/gui/models/windows/pm_wins/add_new.py +19 -0
  45. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/gui/models/windows/start.py +98 -0
  46. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/gui/run.py +20 -0
  47. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/helpers/__init__.py +0 -0
  48. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/helpers/logger.py +42 -0
  49. monopolpy_companion-1.0.dev41/monopolpy_companion/lib/helpers/popup_man.py +29 -0
  50. monopolpy_companion-1.0.dev41/monopolpy_companion/plugins.py +158 -0
  51. monopolpy_companion-1.0.dev41/monopolpy_companion/ui/__init__.py +7 -0
  52. monopolpy_companion-1.0.dev41/monopolpy_companion/ui/account_dialog.py +365 -0
  53. monopolpy_companion-1.0.dev41/monopolpy_companion/ui/app.py +34 -0
  54. monopolpy_companion-1.0.dev41/monopolpy_companion/ui/branding.py +45 -0
  55. monopolpy_companion-1.0.dev41/monopolpy_companion/ui/dev_tools_dialog.py +122 -0
  56. monopolpy_companion-1.0.dev41/monopolpy_companion/ui/dialogs.py +317 -0
  57. monopolpy_companion-1.0.dev41/monopolpy_companion/ui/fonts.py +89 -0
  58. monopolpy_companion-1.0.dev41/monopolpy_companion/ui/main_window.py +1535 -0
  59. monopolpy_companion-1.0.dev41/monopolpy_companion/ui/map_unlock.py +123 -0
  60. monopolpy_companion-1.0.dev41/monopolpy_companion/ui/property_tracker.py +221 -0
  61. monopolpy_companion-1.0.dev41/monopolpy_companion/ui/resources/Caveat-OFL.txt +93 -0
  62. monopolpy_companion-1.0.dev41/monopolpy_companion/ui/resources/Caveat.ttf +0 -0
  63. monopolpy_companion-1.0.dev41/monopolpy_companion/ui/resources/SourceSans3-OFL.txt +93 -0
  64. monopolpy_companion-1.0.dev41/monopolpy_companion/ui/resources/SourceSans3.ttf +0 -0
  65. monopolpy_companion-1.0.dev41/monopolpy_companion/ui/theme.py +320 -0
  66. monopolpy_companion-1.0.dev41/monopolpy_companion/ui/trade_dialog.py +187 -0
  67. monopolpy_companion-1.0.dev41/monopolpy_companion/ui/widgets.py +260 -0
  68. monopolpy_companion-1.0.dev41/pyproject.toml +30 -0
@@ -0,0 +1,204 @@
1
+ Metadata-Version: 2.4
2
+ Name: monopolpy_companion
3
+ Version: 1.0.dev41
4
+ Summary: Electronic banker, game engine, and optional desktop GUI for physical Monopoly
5
+ Author: Taylor B.
6
+ Author-email: 43686206+tayjaybabee@users.noreply.github.com
7
+ Requires-Python: >=3.10,<3.15
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Classifier: Programming Language :: Python :: 3.14
14
+ Provides-Extra: gui
15
+ Provides-Extra: legacy-gui
16
+ Requires-Dist: PySide6 (>=6.8,<7) ; extra == "gui"
17
+ Requires-Dist: PyYAML (>=6.0,<7.0) ; extra == "legacy-gui"
18
+ Requires-Dist: colorlog (>=6.10.1,<7.0.0) ; extra == "legacy-gui"
19
+ Requires-Dist: cryptography (>=44,<47)
20
+ Requires-Dist: inspy-logger (>=3.2.4,<4.0)
21
+ Requires-Dist: pysimplegui-4-foss (>=4.60.4.1,<5.0.0.0) ; extra == "legacy-gui"
22
+ Description-Content-Type: text/markdown
23
+
24
+ # MonopolPy Companion
25
+
26
+ The **Marauder’s Map** keeps developer grants out of the way during normal
27
+ play. Open it with **Ctrl+Shift+M** to discover the two parchment dialogs.
28
+ Once unlocked, its toolbar button appears at startup and becomes usable in
29
+ eligible games. See the [Marauder’s Map guide](docs/MARAUDERS_MAP.md)
30
+ for the phrases, profile state, and technical details.
31
+
32
+ A reusable Python library for managing money, property ownership, movement,
33
+ rent, mortgages, buildings, and save files while playing **physical Monopoly**.
34
+ The optional PySide6 dashboard uses a board-inspired card layout with PIN-protected
35
+ player accounts, statistics, a dice simulator, a mortgage calculator, and visible
36
+ purchase confirmations. The old PySimpleGUI shell remains available for migration.
37
+
38
+ The dashboard title uses Metro Retro NF when installed. You can also place
39
+ `MetroRetroNF.ttf` in the app data folder at
40
+ `Documents/Games/Monopolpy_Companion/fonts` to use it without installing it
41
+ system-wide. [Metro Retro NF by Nick Curtis](https://www.1001fonts.com/metro-retro-font.html)
42
+
43
+ **Python:** 3.10+ | **Logging:** InspyLogger 3.x | **Version:** 1.0.dev8
44
+
45
+ Headless library: `python -m pip install .`
46
+
47
+ Qt desktop GUI: `python -m pip install '.[gui]'`
48
+
49
+ Run dashboard: `monopolpy-companion --gui`
50
+
51
+ Old GUI: `python -m pip install '.[legacy-gui]'`, then
52
+ `monopolpy-companion --legacy-gui`
53
+
54
+ On Windows, the dashboard can also be launched with
55
+ `python -m monopolpy_companion.cli --gui`.
56
+
57
+ ```python
58
+ from monopolpy_companion import GameEngine, SessionRepository, create_standard_session
59
+
60
+ session = create_standard_session('Game Night', ['Avery', 'Blake'])
61
+ engine = GameEngine(session)
62
+ engine.purchase(session.players[0].player_id, 1)
63
+ engine.move_by_dice(session.players[0].player_id, 2, 3)
64
+ SessionRepository().save(session)
65
+ ```
66
+
67
+ See [Accounts and statistics](docs/ACCOUNTS_AND_STATISTICS.md),
68
+ [Desktop GUI guide](docs/GUI.md), [Library API](docs/LIBRARY_API.md),
69
+ [Architecture](docs/LIBRARY_ARCHITECTURE.md),
70
+ and the [playable companion roadmap](docs/PLAYABLE_COMPANION_ROADMAP.md).
71
+
72
+ ## Original project notes
73
+
74
+ [![Updates](https://pyup.io/repos/github/Inspyre-Softworks/monopolpy_companion/shield.svg)](https://pyup.io/repos/github/Inspyre-Softworks/monopolpy_companion/) [![Python 3](https://pyup.io/repos/github/Inspyre-Softworks/monopolpy_companion/python-3-shield.svg)](https://pyup.io/repos/github/Inspyre-Softworks/monopolpy_companion/)
75
+
76
+
77
+
78
+ The MonopolPy Companion App aims to provide useful utilities that will help you get more out of the awesome game of Monopoly.
79
+
80
+ * peace of mind:
81
+ - Banker: no more human bankers trying to do math 3 hours into a session. lament no more as the driving feature of this application is an automatic bank teller! This feature will include:
82
+
83
+ * User money tracker: I know we all love those multicolored cat attractant, table-clinging bits of joy known as Monopoly-money, but cats, kids, entropy. This is where MC will step-in acting as the wallet for all this session's players. This will include the option to PIN or password protect your transactions for that play-session in order to ensure fairness for times when you may happen to be away from the board ( and therefore your monies)
84
+
85
+ * Bank Asset Manager & Player Asset Tracker (BAM and PAT) (both can toggle on.off prior to starting of the game): The program can manage the deeds in the game including mortgages and the proper amount in order to pay one or more mortgaged properties off/how much you'll borrow upon mortgaging one or more properties.
86
+ * Automatic Auction Manager: self-explanatory
87
+ * Keeps logs of all transactions
88
+
89
+ - Wallet: MC will have the ability to keep track of the players' session-wallet (if that's a feature you enable in the Start screen). This ensures:
90
+ * All transactions get logged, and are reviewable at any time during the session, by any player
91
+ * An option to pin-secure or password-secure one's transactions is made available
92
+ * The deeds (including information like what they're worth, etc) will be tracked
93
+ * Unlocks the Monopoly Asset Calculator(B-Priority)
94
+
95
+ - Monopoly Asset Calculator: Use this nifty calculator for figuring out what your next move is(B-Priority)
96
+
97
+ - Enhanced Private Trading Mediator:
98
+ * Users can trade:
99
+ - Rent immunity
100
+ - Get out of jail cards
101
+ - Properties
102
+ - Loans
103
+
104
+
105
+
106
+
107
+
108
+ ### Local accounts and desktop preferences
109
+
110
+ Use **Create Account** to register a reusable username, optional encryption
111
+ password and optional 4–8 digit transaction PIN. New Game offers existing
112
+ accounts in a dropdown; select each account and click **Add selected account**.
113
+ Guest names can still be entered in the Players field. Passwords unlock account
114
+ files once per application session. PINs authorize transactions separately.
115
+
116
+ Account files use authenticated AES-GCM encryption with password-derived scrypt
117
+ keys when a password is supplied. Every account write keeps that encryption.
118
+ Usernames remain visible for account selection. Game saves are separate,
119
+ unencrypted JSON files; PINs protect casual terminal access rather than tampering
120
+ with save files. There is no password recovery.
121
+
122
+ **Settings** saves the theme, animated button glow and default landing alerts
123
+ between launches. The styled title bar supports dragging, double-click maximize,
124
+ minimize, restore and close; the bottom corner provides a resize grip.
125
+
126
+
127
+ **Game Settings** applies to the active saved game: GO salary defaults to $200;
128
+ set it to $0 to disable it. The optional **Double salary when landing on GO**
129
+ house rule defaults off and pays twice that amount on an exact landing only.
130
+ Salary payments appear in the ledger and in a gold notification for ten seconds.
131
+ Moves explicitly excluding GO collection and being sent directly to Jail do not
132
+ pay salary.
133
+
134
+ Dice rolls follow the current turn: use a simulated roll before rolling again.
135
+ After moving, another roll requires doubles. Pending dice and turn eligibility
136
+ are saved with the game; Next turn makes the incoming player eligible to roll.
137
+
138
+
139
+ When the current player is in Jail, **Roll for doubles** shows attempts used
140
+ out of three, and **Pay $50 bail and release** offers an immediate paid exit.
141
+ Just visiting does not show these controls. Each jail turn permits one attempt;
142
+ a failed first or second attempt allows Next turn. Doubles release and move the
143
+ player without earning another roll. After the third failed attempt, pay bail
144
+ before moving by that saved third roll. Paying before attempting doubles allows
145
+ a normal roll. Insufficient cash leaves the player in Jail until payment is
146
+ possible. An owned jail release card can be used before attempting doubles.
147
+
148
+ Next turn stays disabled until the current player has completed required dice
149
+ movement, including extra rolls earned by doubles, or completed a jail attempt.
150
+ Being sent to Jail ends the turn immediately.
151
+
152
+
153
+ Landing on tax or an opponent's unmortgaged deed records an unpaid charge.
154
+ **Amount owed** and **Pay amount owed** show and settle the charge; existing
155
+ Pay tax and Collect rent actions settle the same charge without charging twice.
156
+ Next turn and further dice rolls stay disabled until rent and tax are paid.
157
+ Charges survive save/load and retain the rent quote from the landing, including
158
+ utility dice totals. Turning off landing alerts does not waive payment.
159
+ Manual transfers are separate transactions and do not silently dismiss a charge.
160
+
161
+
162
+ ### Property ownership dashboard
163
+
164
+ The left pane stacks a horizontal ownership tracker for each player, with their
165
+ name and cash at the left and a highlighted row for the current turn. Each panel arranges groups across two lines and
166
+ shows the eight color sets, then four black Railroads and two gray Utilities;
167
+ properties follow board order within their group. Empty rectangles match the panel background and have thick
168
+ set-colored borders; owned deeds are solid, and mortgaged deeds are dimmed with
169
+ an X. A gold outline surrounds every fully owned group, including Railroads and
170
+ Utilities (mortgages do not remove ownership). Hover over a rectangle for its
171
+ property name and status. The strips scroll horizontally on smaller windows.
172
+
173
+ The right pane is an independently scrollable transaction log, newest first,
174
+ with all recorded transactions. Players & banker and Board & properties tabs
175
+ keep the game controls below the ownership trackers. Purchases, mortgages,
176
+ unmortgages, saved-game loads and turn changes refresh the trackers immediately.
177
+
178
+
179
+ **Trade** opens a two-player cash, property and jail-card exchange. Review each
180
+ side, bank mortgage-interest charges and resulting balances before confirming.
181
+ Both players must unlock their PINs if enabled. Mortgaged deeds stay mortgaged;
182
+ the recipient pays 10% mortgage interest. Sell buildings across a color group
183
+ before trading any property in it. Trades are validated together before changes,
184
+ autosaved and logged, and refresh both ownership trackers. Trades do not cancel
185
+ existing rent or tax obligations. These restrictions follow the
186
+ [classic Hasbro rules](https://www.hasbro.com/common/instruct/Monopoly.pdf).
187
+
188
+
189
+ **Mortgages** opens the selected player's multi-property planner directly.
190
+ Choose Mortgage or Unmortgage and click each deed to select multiple properties.
191
+ The live preview shows individual amounts, total proceeds, the full cost to
192
+ unmortgage those same deeds (principal plus interest), and cash after applying.
193
+ Unmortgage previews show the total repayment and resulting balance; unaffordable
194
+ selections cannot be applied. Confirm the itemized preview to commit the batch.
195
+ The Board & properties tab also provides Mortgage properties and Unmortgage
196
+ properties shortcuts to this planner.
197
+
198
+
199
+ Game Settings enables **Three consecutive doubles send the player directly to
200
+ Jail** by default. The third double ends the turn immediately, without moving
201
+ by that roll or collecting GO salary. Uncheck this option to disable the rule
202
+ for the active saved game. Both manual dice entry and simulated rolls enforce
203
+ it; the consecutive-double count survives saving and reopening mid-turn.
204
+
@@ -0,0 +1,180 @@
1
+ # MonopolPy Companion
2
+
3
+ The **Marauder’s Map** keeps developer grants out of the way during normal
4
+ play. Open it with **Ctrl+Shift+M** to discover the two parchment dialogs.
5
+ Once unlocked, its toolbar button appears at startup and becomes usable in
6
+ eligible games. See the [Marauder’s Map guide](docs/MARAUDERS_MAP.md)
7
+ for the phrases, profile state, and technical details.
8
+
9
+ A reusable Python library for managing money, property ownership, movement,
10
+ rent, mortgages, buildings, and save files while playing **physical Monopoly**.
11
+ The optional PySide6 dashboard uses a board-inspired card layout with PIN-protected
12
+ player accounts, statistics, a dice simulator, a mortgage calculator, and visible
13
+ purchase confirmations. The old PySimpleGUI shell remains available for migration.
14
+
15
+ The dashboard title uses Metro Retro NF when installed. You can also place
16
+ `MetroRetroNF.ttf` in the app data folder at
17
+ `Documents/Games/Monopolpy_Companion/fonts` to use it without installing it
18
+ system-wide. [Metro Retro NF by Nick Curtis](https://www.1001fonts.com/metro-retro-font.html)
19
+
20
+ **Python:** 3.10+ | **Logging:** InspyLogger 3.x | **Version:** 1.0.dev8
21
+
22
+ Headless library: `python -m pip install .`
23
+
24
+ Qt desktop GUI: `python -m pip install '.[gui]'`
25
+
26
+ Run dashboard: `monopolpy-companion --gui`
27
+
28
+ Old GUI: `python -m pip install '.[legacy-gui]'`, then
29
+ `monopolpy-companion --legacy-gui`
30
+
31
+ On Windows, the dashboard can also be launched with
32
+ `python -m monopolpy_companion.cli --gui`.
33
+
34
+ ```python
35
+ from monopolpy_companion import GameEngine, SessionRepository, create_standard_session
36
+
37
+ session = create_standard_session('Game Night', ['Avery', 'Blake'])
38
+ engine = GameEngine(session)
39
+ engine.purchase(session.players[0].player_id, 1)
40
+ engine.move_by_dice(session.players[0].player_id, 2, 3)
41
+ SessionRepository().save(session)
42
+ ```
43
+
44
+ See [Accounts and statistics](docs/ACCOUNTS_AND_STATISTICS.md),
45
+ [Desktop GUI guide](docs/GUI.md), [Library API](docs/LIBRARY_API.md),
46
+ [Architecture](docs/LIBRARY_ARCHITECTURE.md),
47
+ and the [playable companion roadmap](docs/PLAYABLE_COMPANION_ROADMAP.md).
48
+
49
+ ## Original project notes
50
+
51
+ [![Updates](https://pyup.io/repos/github/Inspyre-Softworks/monopolpy_companion/shield.svg)](https://pyup.io/repos/github/Inspyre-Softworks/monopolpy_companion/) [![Python 3](https://pyup.io/repos/github/Inspyre-Softworks/monopolpy_companion/python-3-shield.svg)](https://pyup.io/repos/github/Inspyre-Softworks/monopolpy_companion/)
52
+
53
+
54
+
55
+ The MonopolPy Companion App aims to provide useful utilities that will help you get more out of the awesome game of Monopoly.
56
+
57
+ * peace of mind:
58
+ - Banker: no more human bankers trying to do math 3 hours into a session. lament no more as the driving feature of this application is an automatic bank teller! This feature will include:
59
+
60
+ * User money tracker: I know we all love those multicolored cat attractant, table-clinging bits of joy known as Monopoly-money, but cats, kids, entropy. This is where MC will step-in acting as the wallet for all this session's players. This will include the option to PIN or password protect your transactions for that play-session in order to ensure fairness for times when you may happen to be away from the board ( and therefore your monies)
61
+
62
+ * Bank Asset Manager & Player Asset Tracker (BAM and PAT) (both can toggle on.off prior to starting of the game): The program can manage the deeds in the game including mortgages and the proper amount in order to pay one or more mortgaged properties off/how much you'll borrow upon mortgaging one or more properties.
63
+ * Automatic Auction Manager: self-explanatory
64
+ * Keeps logs of all transactions
65
+
66
+ - Wallet: MC will have the ability to keep track of the players' session-wallet (if that's a feature you enable in the Start screen). This ensures:
67
+ * All transactions get logged, and are reviewable at any time during the session, by any player
68
+ * An option to pin-secure or password-secure one's transactions is made available
69
+ * The deeds (including information like what they're worth, etc) will be tracked
70
+ * Unlocks the Monopoly Asset Calculator(B-Priority)
71
+
72
+ - Monopoly Asset Calculator: Use this nifty calculator for figuring out what your next move is(B-Priority)
73
+
74
+ - Enhanced Private Trading Mediator:
75
+ * Users can trade:
76
+ - Rent immunity
77
+ - Get out of jail cards
78
+ - Properties
79
+ - Loans
80
+
81
+
82
+
83
+
84
+
85
+ ### Local accounts and desktop preferences
86
+
87
+ Use **Create Account** to register a reusable username, optional encryption
88
+ password and optional 4–8 digit transaction PIN. New Game offers existing
89
+ accounts in a dropdown; select each account and click **Add selected account**.
90
+ Guest names can still be entered in the Players field. Passwords unlock account
91
+ files once per application session. PINs authorize transactions separately.
92
+
93
+ Account files use authenticated AES-GCM encryption with password-derived scrypt
94
+ keys when a password is supplied. Every account write keeps that encryption.
95
+ Usernames remain visible for account selection. Game saves are separate,
96
+ unencrypted JSON files; PINs protect casual terminal access rather than tampering
97
+ with save files. There is no password recovery.
98
+
99
+ **Settings** saves the theme, animated button glow and default landing alerts
100
+ between launches. The styled title bar supports dragging, double-click maximize,
101
+ minimize, restore and close; the bottom corner provides a resize grip.
102
+
103
+
104
+ **Game Settings** applies to the active saved game: GO salary defaults to $200;
105
+ set it to $0 to disable it. The optional **Double salary when landing on GO**
106
+ house rule defaults off and pays twice that amount on an exact landing only.
107
+ Salary payments appear in the ledger and in a gold notification for ten seconds.
108
+ Moves explicitly excluding GO collection and being sent directly to Jail do not
109
+ pay salary.
110
+
111
+ Dice rolls follow the current turn: use a simulated roll before rolling again.
112
+ After moving, another roll requires doubles. Pending dice and turn eligibility
113
+ are saved with the game; Next turn makes the incoming player eligible to roll.
114
+
115
+
116
+ When the current player is in Jail, **Roll for doubles** shows attempts used
117
+ out of three, and **Pay $50 bail and release** offers an immediate paid exit.
118
+ Just visiting does not show these controls. Each jail turn permits one attempt;
119
+ a failed first or second attempt allows Next turn. Doubles release and move the
120
+ player without earning another roll. After the third failed attempt, pay bail
121
+ before moving by that saved third roll. Paying before attempting doubles allows
122
+ a normal roll. Insufficient cash leaves the player in Jail until payment is
123
+ possible. An owned jail release card can be used before attempting doubles.
124
+
125
+ Next turn stays disabled until the current player has completed required dice
126
+ movement, including extra rolls earned by doubles, or completed a jail attempt.
127
+ Being sent to Jail ends the turn immediately.
128
+
129
+
130
+ Landing on tax or an opponent's unmortgaged deed records an unpaid charge.
131
+ **Amount owed** and **Pay amount owed** show and settle the charge; existing
132
+ Pay tax and Collect rent actions settle the same charge without charging twice.
133
+ Next turn and further dice rolls stay disabled until rent and tax are paid.
134
+ Charges survive save/load and retain the rent quote from the landing, including
135
+ utility dice totals. Turning off landing alerts does not waive payment.
136
+ Manual transfers are separate transactions and do not silently dismiss a charge.
137
+
138
+
139
+ ### Property ownership dashboard
140
+
141
+ The left pane stacks a horizontal ownership tracker for each player, with their
142
+ name and cash at the left and a highlighted row for the current turn. Each panel arranges groups across two lines and
143
+ shows the eight color sets, then four black Railroads and two gray Utilities;
144
+ properties follow board order within their group. Empty rectangles match the panel background and have thick
145
+ set-colored borders; owned deeds are solid, and mortgaged deeds are dimmed with
146
+ an X. A gold outline surrounds every fully owned group, including Railroads and
147
+ Utilities (mortgages do not remove ownership). Hover over a rectangle for its
148
+ property name and status. The strips scroll horizontally on smaller windows.
149
+
150
+ The right pane is an independently scrollable transaction log, newest first,
151
+ with all recorded transactions. Players & banker and Board & properties tabs
152
+ keep the game controls below the ownership trackers. Purchases, mortgages,
153
+ unmortgages, saved-game loads and turn changes refresh the trackers immediately.
154
+
155
+
156
+ **Trade** opens a two-player cash, property and jail-card exchange. Review each
157
+ side, bank mortgage-interest charges and resulting balances before confirming.
158
+ Both players must unlock their PINs if enabled. Mortgaged deeds stay mortgaged;
159
+ the recipient pays 10% mortgage interest. Sell buildings across a color group
160
+ before trading any property in it. Trades are validated together before changes,
161
+ autosaved and logged, and refresh both ownership trackers. Trades do not cancel
162
+ existing rent or tax obligations. These restrictions follow the
163
+ [classic Hasbro rules](https://www.hasbro.com/common/instruct/Monopoly.pdf).
164
+
165
+
166
+ **Mortgages** opens the selected player's multi-property planner directly.
167
+ Choose Mortgage or Unmortgage and click each deed to select multiple properties.
168
+ The live preview shows individual amounts, total proceeds, the full cost to
169
+ unmortgage those same deeds (principal plus interest), and cash after applying.
170
+ Unmortgage previews show the total repayment and resulting balance; unaffordable
171
+ selections cannot be applied. Confirm the itemized preview to commit the batch.
172
+ The Board & properties tab also provides Mortgage properties and Unmortgage
173
+ properties shortcuts to this planner.
174
+
175
+
176
+ Game Settings enables **Three consecutive doubles send the player directly to
177
+ Jail** by default. The third double ends the turn immediately, without moving
178
+ by that roll or collecting GO salary. Uncheck this option to disable the rule
179
+ for the active saved game. Both manual dice entry and simulated rolls enforce
180
+ it; the consecutive-double count survives saving and reopening mid-turn.
@@ -0,0 +1,62 @@
1
+ """MonopolPy Companion's stable, GUI-independent public API.
2
+
3
+ Importing this package never launches the GUI or starts a game session.
4
+ The canonical data models, engine and repository are also available from
5
+ `monopolpy_companion.game` for backward compatibility.
6
+ """
7
+
8
+ from .game import (
9
+ GameEngine,
10
+ MortgageCalculator,
11
+ MortgageQuote,
12
+ PlayerAccount,
13
+ StatisticsService,
14
+ GameplayStatistics,
15
+ FinancialStatistics,
16
+ PlayerReport,
17
+ GameEvent,
18
+ GameRules,
19
+ GameSession,
20
+ MoveResult,
21
+ Player,
22
+ PropertyState,
23
+ SavedSessionInfo,
24
+ SessionRepository,
25
+ Space,
26
+ SpaceType,
27
+ Transaction,
28
+ build_standard_board,
29
+ create_standard_session,
30
+ get_game_logger,
31
+ list_saved_sessions,
32
+ load_session,
33
+ save_session,
34
+ )
35
+
36
+ __all__ = [
37
+ 'GameEngine',
38
+ 'MortgageCalculator',
39
+ 'MortgageQuote',
40
+ 'PlayerAccount',
41
+ 'StatisticsService',
42
+ 'GameplayStatistics',
43
+ 'FinancialStatistics',
44
+ 'PlayerReport',
45
+ 'GameEvent',
46
+ 'GameRules',
47
+ 'GameSession',
48
+ 'MoveResult',
49
+ 'Player',
50
+ 'PropertyState',
51
+ 'SavedSessionInfo',
52
+ 'SessionRepository',
53
+ 'Space',
54
+ 'SpaceType',
55
+ 'Transaction',
56
+ 'build_standard_board',
57
+ 'create_standard_session',
58
+ 'get_game_logger',
59
+ 'list_saved_sessions',
60
+ 'load_session',
61
+ 'save_session',
62
+ ]
@@ -0,0 +1,75 @@
1
+ """Console launcher for library management and optional desktop GUIs."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+ from pathlib import Path
7
+
8
+ from .game import SessionRepository
9
+
10
+
11
+ def main(argv: list[str] | None = None) -> int:
12
+ """Run a headless command or launch the installed desktop frontend.
13
+
14
+ Args:
15
+ argv: Explicit CLI arguments for testing or embedding.
16
+
17
+ Returns:
18
+ Program exit status.
19
+ """
20
+ parser = argparse.ArgumentParser(
21
+ prog='monopolpy-companion',
22
+ description='Electronic banker for a physical Monopoly game.',
23
+ )
24
+ choice = parser.add_mutually_exclusive_group()
25
+ choice.add_argument('--list-sessions', action='store_true', help='List saved sessions')
26
+ choice.add_argument('--summary', type=Path, help='Summarize a saved JSON session')
27
+ choice.add_argument('--gui', action='store_true', help='Launch the new Qt dashboard')
28
+ choice.add_argument('--legacy-gui', action='store_true', help='Launch the old PySimpleGUI shell')
29
+ choice.add_argument('--list-plugins', action='store_true',
30
+ help='List installed plugin entry points without loading them')
31
+ parser.add_argument('--enable-plugin', action='append', default=[],
32
+ metavar='ID', help='Enable a plugin for this GUI launch')
33
+ args = parser.parse_args(argv)
34
+ if args.enable_plugin and not args.gui:
35
+ parser.error('--enable-plugin requires --gui')
36
+ if args.list_plugins:
37
+ from .plugins import installed_plugins
38
+
39
+ for entry in sorted(installed_plugins(), key=lambda item: (item.name, item.value)):
40
+ print(f'{entry.name}: {entry.value}')
41
+ return 0
42
+
43
+ if args.gui:
44
+ try:
45
+ from .ui.app import run
46
+ except ImportError as exc:
47
+ parser.error(f'Qt GUI requires the optional gui extra: {exc}')
48
+ return run(args.enable_plugin)
49
+
50
+ if args.legacy_gui:
51
+ try:
52
+ from .lib.gui.run import run
53
+ except ImportError as exc:
54
+ parser.error(f'Legacy GUI requires the optional legacy-gui extra: {exc}')
55
+ run()
56
+ return 0
57
+
58
+ repository = SessionRepository()
59
+ if args.list_sessions:
60
+ for item in repository.list_sessions():
61
+ print(f'{item.display_name}: {item.path}')
62
+ return 0
63
+ if args.summary is not None:
64
+ try:
65
+ session = repository.load(args.summary)
66
+ except (OSError, ValueError, KeyError, TypeError) as exc:
67
+ parser.error(f'Cannot load saved session: {exc}')
68
+ print('\n'.join(session.summary_lines()))
69
+ return 0
70
+ parser.print_help()
71
+ return 0
72
+
73
+
74
+ if __name__ == '__main__':
75
+ raise SystemExit(main())
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env python3
2
+
3
+ """
4
+
5
+ Holds changable default values for certain program variables
6
+
7
+ """
8
+ import os
9
+ from os import getcwd
10
+ import pathlib
11
+
12
+ prog_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
13
+
@@ -0,0 +1,10 @@
1
+ ; Pretty self-explanatory, and really you can let the program handle making changes to this file.
2
+ ;
3
+ [localization_settings]
4
+ ; Let's talk fields:
5
+ ;
6
+ ; timezone=
7
+ ; Options:
8
+ ; timezone =
9
+ timezone = UTC
10
+ f_clock = US
@@ -0,0 +1,3 @@
1
+ gui_settings:
2
+ grab_anywhere: false
3
+ player_database: ~/Documents/Games/Monopolpy_Companion/databases/players.yml