added documentation for Rent

This commit is contained in:
Yvonne Schmidt 2024-12-02 08:36:54 +01:00
parent a50821f2e6
commit 459a54ac5d

View File

@ -16,14 +16,32 @@ import pp.monopoly.client.MonopolyApp;
import pp.monopoly.notification.Sound; import pp.monopoly.notification.Sound;
/** /**
* Rent popup is triggered when a player enters a field owned by another player and needs to pay rent. * Rent is a popup that is triggered when a player lands on a property owned by another player
* and needs to pay rent in the Monopoly application.
* <p>
* Displays the rent amount and the recipient player's name, with an option to confirm the payment.
* </p>
*/ */
public class Rent extends Dialog { public class Rent extends Dialog {
/** Reference to the Monopoly application instance. */
private final MonopolyApp app; private final MonopolyApp app;
/** Semi-transparent overlay background for the popup. */
private final Geometry overlayBackground; private final Geometry overlayBackground;
/** Main container for the rent information and action. */
private final Container rentContainer; private final Container rentContainer;
/** Background container providing a border for the rent popup. */
private final Container backgroundContainer; private final Container backgroundContainer;
/**
* Constructs the Rent popup displaying the rent amount and recipient player.
*
* @param app the Monopoly application instance
* @param playerName the name of the player to whom the rent is owed
* @param amount the amount of rent to be paid
*/
public Rent(MonopolyApp app, String playerName, int amount) { public Rent(MonopolyApp app, String playerName, int amount) {
super(app.getDialogManager()); super(app.getDialogManager());
this.app = app; this.app = app;