Finished Class City (Cleanup and Javadoc)

This commit is contained in:
Leonardo Brandenberger 2021-12-10 10:38:01 +01:00
parent 9bb4550926
commit 74e19ad416
1 changed files with 18 additions and 2 deletions

View File

@ -1,13 +1,29 @@
package ch.zhaw.catan;
import java.awt.Point;
import java.awt.*;
/**
* City Class Subclass of Structure to hold city at desired point.
*
* @author Andrin Fassbind
*/
public class City extends Settlement {
/**
* Constructs a City Object and the desired Position with the desired Faction.
*
* @param faction of the player
* @param position where the city will be placed
*/
public City(Config.Faction faction, Point position) {
super(faction, position);
}
/**
* Overrides toString method to show faction name in uppercase.
*
* @return String Faction in uppercase
*/
@Override
public String toString() {
return super.getFaction().toString().toUpperCase();
}