updates in JavaDoc
This commit is contained in:
parent
378fdde58a
commit
99eab9ad69
|
@ -5,7 +5,6 @@ import java.util.List;
|
|||
//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,
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
|
|
@ -3,21 +3,40 @@ package ch.zhaw.catan;
|
|||
import java.awt.*;
|
||||
|
||||
/// TODO: 09/12/2021 Java Doc
|
||||
|
||||
/**
|
||||
* sub Class of Structure
|
||||
* Can be saved in Siedler Board on Edges.
|
||||
*/
|
||||
public class Road extends Structure {
|
||||
|
||||
//the coordinates of the start and the end Point of the road.
|
||||
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) {
|
||||
super(faction);
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return the coordinates of the start Point
|
||||
*/
|
||||
public Point getStart() {
|
||||
return start;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return the coordinates of the end Point
|
||||
*/
|
||||
public Point getEnd() {
|
||||
return end;
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* @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) {
|
||||
List<Settlement> corners = getCorners();
|
||||
|
|
Loading…
Reference in New Issue