SiedlerGame and general model implementation #16

Merged
costajon merged 27 commits from siedlergame-implementation into dev 2021-11-28 15:19:16 +00:00
costajon commented 2021-11-26 09:37:48 +00:00 (Migrated from github.zhaw.ch)

Closes #2

Closes #2
zumbrseb (Migrated from github.zhaw.ch) reviewed 2021-11-26 10:02:46 +00:00
@ -22,0 +48,4 @@
* An array of current {@link Player} objects in the game.
*/
private Player[] players;
zumbrseb (Migrated from github.zhaw.ch) commented 2021-11-26 09:42:58 +00:00

javadoc

javadoc
@ -47,3 +107,4 @@
}
}
/**
zumbrseb (Migrated from github.zhaw.ch) commented 2021-11-26 09:51:53 +00:00
        return getCurrentPlayer().getFaction();

```suggestion return getCurrentPlayer().getFaction(); ```
zumbrseb (Migrated from github.zhaw.ch) commented 2021-11-26 09:44:26 +00:00
        for (int i = 0; i < numberOfPlayers && i < factions.length; i++) {

In case Faction is modified

```suggestion for (int i = 0; i < numberOfPlayers && i < factions.length; i++) { ``` In case Faction is modified
@ -61,8 +122,11 @@ public class SiedlerGame {
* @return the list with player's factions
zumbrseb (Migrated from github.zhaw.ch) commented 2021-11-26 09:51:38 +00:00
        return getCurrentPlayer().getResourceCount(resource);

```suggestion return getCurrentPlayer().getResourceCount(resource); ```
zumbrseb (Migrated from github.zhaw.ch) commented 2021-11-26 09:51:20 +00:00

A getCurrentPlayer method will be useful for functions with the game logic in them.


private Player getCurrentPlayer() {
    return players[currentPlayer];
}
A getCurrentPlayer method will be useful for functions with the game logic in them. ```suggestion private Player getCurrentPlayer() { return players[currentPlayer]; } ```
@ -0,0 +5,4 @@
*
* @author Jonas Costa
*/
public enum ActionType {
zumbrseb (Migrated from github.zhaw.ch) commented 2021-11-26 09:52:08 +00:00

javadoc

javadoc
@ -0,0 +5,4 @@
*
* @author Jonas Costa
*/
public class SiedlerCity extends SiedlerSettlement {
zumbrseb (Migrated from github.zhaw.ch) commented 2021-11-26 09:52:21 +00:00

javadoc

javadoc
@ -0,0 +60,4 @@
return diceValue == other.diceValue && fieldType == other.fieldType;
}
zumbrseb (Migrated from github.zhaw.ch) commented 2021-11-26 09:52:47 +00:00

?

?
@ -0,0 +5,4 @@
*
* @author Jonas Costa
*/
public class SiedlerSettlement extends SiedlerStructure {
zumbrseb (Migrated from github.zhaw.ch) commented 2021-11-26 09:52:56 +00:00

javadoc

javadoc
zumbrseb (Migrated from github.zhaw.ch) commented 2021-11-26 09:55:35 +00:00

getResourceCount() doesn't exist inn SiedlerSettlement and SiedlerCity

getResourceCount() doesn't exist inn SiedlerSettlement and SiedlerCity
@ -0,0 +5,4 @@
*
* @author Jonas Costa
*/
public class SiedlerStreet extends SiedlerSettlement{
zumbrseb (Migrated from github.zhaw.ch) commented 2021-11-26 09:53:05 +00:00

javadoc

javadoc
@ -0,0 +7,4 @@
*
* @author Jonas Costa
*/
public abstract class SiedlerStructure {
zumbrseb (Migrated from github.zhaw.ch) commented 2021-11-26 09:53:11 +00:00

javadoc

javadoc
@ -0,0 +43,4 @@
SiedlerStructure other = (SiedlerStructure) obj;
return Objects.equals(owner, other.owner);
}
zumbrseb (Migrated from github.zhaw.ch) commented 2021-11-26 09:53:44 +00:00

please generate the hashcode and equals methods

please generate the hashcode and equals methods
zumbrseb (Migrated from github.zhaw.ch) approved these changes 2021-11-27 15:58:40 +00:00
zumbrseb (Migrated from github.zhaw.ch) left a comment

Looks good, apart from the two places where the Javadoc is missing.
But let's still merge it, so others aren't blocked by this.

Looks good, apart from the two places where the Javadoc is missing. But let's still merge it, so others aren't blocked by this.
@ -0,0 +10,4 @@
* The player wants to trade with the bank (trading with other players or ports
* isn't supported)
*/
TRADE,
zumbrseb (Migrated from github.zhaw.ch) commented 2021-11-27 15:57:05 +00:00

javadoc of the individual enum would probably be useful.

For example:
/**

  • The keyword, which indicates that the player wants to trade with the bank
    */
    TRADE,
javadoc of the individual enum would probably be useful. For example: /** * The keyword, which indicates that the player wants to trade with the bank */ TRADE,
@ -0,0 +13,4 @@
/**
* Specifies what type of field this is.
*/
private Land fieldType;
zumbrseb (Migrated from github.zhaw.ch) commented 2021-11-27 15:54:22 +00:00

java doc

java doc
zumbrseb (Migrated from github.zhaw.ch) requested changes 2021-11-27 18:03:10 +00:00
zumbrseb (Migrated from github.zhaw.ch) left a comment

SiedlerBoard's generic types aren't correct.
The field type should be SiedlerField, the corners SiedlerSettelement and the edges SiedlerStreets. The field annotations could be set to the type Void as we currently aren't planing using this feature (correct?).

SiedlerBoard's generic types aren't correct. The field type should be `SiedlerField`, the corners `SiedlerSettelement` and the edges `SiedlerStreets`. The field annotations could be set to the type `Void` as we currently aren't planing using this feature (correct?).
zumbrseb (Migrated from github.zhaw.ch) commented 2021-11-27 17:58:52 +00:00

public should be in front of static

    public static SiedlerBoard createStandartSiedlerBoard() {
        SiedlerBoard board = new SiedlerBoard();
        Map<Point, Integer> standardDiceNumbers = Config.getStandardDiceNumberPlacement();
        for (Entry<Point, Land> standardLandEntry : Config.getStandardLandPlacement().entrySet()) {
            board.addField(standardLandEntry.getKey(), new SiedlerField(standardLandEntry.getValue(),
                    standardDiceNumbers.getOrDefault(standardLandEntry.getKey(), -1)));
        }
        return board;
    }

`public` should be in front of `static` ```suggestion public static SiedlerBoard createStandartSiedlerBoard() { SiedlerBoard board = new SiedlerBoard(); Map<Point, Integer> standardDiceNumbers = Config.getStandardDiceNumberPlacement(); for (Entry<Point, Land> standardLandEntry : Config.getStandardLandPlacement().entrySet()) { board.addField(standardLandEntry.getKey(), new SiedlerField(standardLandEntry.getValue(), standardDiceNumbers.getOrDefault(standardLandEntry.getKey(), -1))); } return board; } ```
zumbrseb (Migrated from github.zhaw.ch) approved these changes 2021-11-28 15:09:04 +00:00
zumbrseb (Migrated from github.zhaw.ch) left a comment

Looks alright

Looks alright
Sign in to join this conversation.
No description provided.