updates in JavaDoc

This commit is contained in:
schrom01 2021-12-09 19:29:00 +01:00
parent 378fdde58a
commit 99eab9ad69
3 changed files with 23 additions and 4 deletions

View File

@ -5,7 +5,6 @@ import java.util.List;
//TODO Java Doc //TODO Java Doc
/** /**
* New Class PLayer
* This class is here in order to maintain the resources of the players, the amount of structures that they can build, * This class is here in order to maintain the resources of the players, the amount of structures that they can build,
* control to see if a player has enough to build a new structure and to add them into a faction. * control to see if a player has enough to build a new structure and to add them into a faction.
*/ */
@ -16,7 +15,7 @@ public class Player {
private final HashMap<Config.Structure, Integer> structureToUse; private final HashMap<Config.Structure, Integer> structureToUse;
/** /**
* The constructor creates a new instance of the player class that initializes the Hashmap resources and structureToUse. * The constructor initializes the faction and the Hashmaps resources and structureToUse.
* *
* @param faction this is the faction of the player. * @param faction this is the faction of the player.
*/ */

View File

@ -3,21 +3,40 @@ package ch.zhaw.catan;
import java.awt.*; import java.awt.*;
/// TODO: 09/12/2021 Java Doc /// TODO: 09/12/2021 Java Doc
/**
* sub Class of Structure
* Can be saved in Siedler Board on Edges.
*/
public class Road extends Structure { public class Road extends Structure {
//the coordinates of the start and the end Point of the road.
private final Point start, end; private final Point start, end;
/**
* Constructor of Road
* @param faction The faction of the owner
* @param start the coordinates of the start Point
* @param end the coordinates of the End Point
*/
public Road(Config.Faction faction, Point start, Point end) { public Road(Config.Faction faction, Point start, Point end) {
super(faction); super(faction);
this.start = start; this.start = start;
this.end = end; this.end = end;
} }
/**
*
* @return the coordinates of the start Point
*/
public Point getStart() { public Point getStart() {
return start; return start;
} }
/**
*
* @return the coordinates of the end Point
*/
public Point getEnd() { public Point getEnd() {
return end; return end;
} }

View File

@ -138,7 +138,8 @@ public class SiedlerBoard extends HexBoard<Config.Land, Settlement, Road, String
/** /**
* This method checks for the player with the longest road according to the siedler game rules. * This method checks for the player with the longest road according to the siedler game rules.
* * @param factionList a List with all factions which can place structures on the board
* @return the faction who owns the longest road with minimum length of 5, null there is no road longer then 4
*/ */
public Config.Faction getLongestRoadFaction(List<Config.Faction> factionList) { public Config.Faction getLongestRoadFaction(List<Config.Faction> factionList) {
List<Settlement> corners = getCorners(); List<Settlement> corners = getCorners();