Select Git revision
Properties.java

Keegan Fernandes authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Properties.java 1.50 KiB
package com.cm6123.monopoly.game;
/**
* Class for properties.
*/
public class Properties {
/**
* The name of the property.
*/
private final String name;
/**
* The price of the property.
*/
private int price;
/**
* The owner of the property.
*/
private Player owner;
/**
* Constructor for property with the name.
*
* @param propertyname the name of the property
*/
public Properties(final String propertyname) {
this.name = propertyname;
this.price = 200;
this.owner = null;
}
/**
* Gets the name of the property.
*
* @return the name of the property
*/
public String getName() {
return name;
}
/**
* Gets the price of the property.
*
* @return the price of the property
*/
public int getPrice() {
return price;
}
/**
* Sets the price of the property.
*
* @param newPrice the new price to set for the property
*/
public void setPrice(final int newPrice) {
this.price = newPrice;
}
/**
* Gets the owner of the property.
*
* @return the owner of the property, or null if the property is not owned
*/
public Player getOwner() {
return owner;
}
/**
* Sets the owner of the property.
*
* @param player the player to set as the owner of the property
*/
public void setOwner(final Player player) {
this.owner = player;
}
}