Using Values of Config in SiedlerGame.java

This commit is contained in:
schrom01 2021-12-09 15:23:34 +01:00
parent 51defac6f3
commit c28efe5331
1 changed files with 2 additions and 2 deletions

View File

@ -35,7 +35,7 @@ public class SiedlerGame {
* three or players is not between two and four
*/
public SiedlerGame(int winPoints, int numberOfPlayers) {
if(winPoints < 3 || numberOfPlayers < 2 || numberOfPlayers > 4) {
if(winPoints < 3 || numberOfPlayers < Config.MIN_NUMBER_OF_PLAYERS || numberOfPlayers > 4) {
throw new IllegalArgumentException();
}
bank = new Bank();
@ -246,7 +246,7 @@ public class SiedlerGame {
resourceArrayList.add(resource);
}
}
if(resourceArrayList.size() > 7){
if(resourceArrayList.size() > Config.MAX_CARDS_IN_HAND_NO_DROP){
int resourcesToRemove =resourceArrayList.size() - (resourceArrayList.size() / 2);
Random random = new Random();
for(int i = 0; i < resourcesToRemove; i++){