Add: Decks Create Slots

This commit is contained in:
rubenpirreram
2026-03-21 17:15:10 +01:00
parent c0733f4cd6
commit 1f966484b8
6 changed files with 160 additions and 34 deletions
@@ -21,20 +21,60 @@ public class Slot {
return Food;
}
// End getters
private char slotId;
// Setters
// End setters
// Constructors
public Slot(int NUpper, int NLower, int Food,int nMinPlayer) throws IllegalArgumentException {
this.NUpper = NUpper;
this.NLower = NLower;
this.Food = Food;
if(Food != 0 && (NUpper != 0 || NLower != 0)){
throw new IllegalArgumentException();
public Slot(char slotId) throws IllegalArgumentException
{
this.slotId = slotId;
this.nMinPlayer=0;
switch(slotId)
{
case 'A':
this.Food = 3;
this.NLower = 0;
this.NUpper = 0;
this.nMinPlayer=5;
break;
case 'B':
this.Food = 0;
this.NLower = 1;
this.NUpper = 0;
break;
case 'C':
this.Food = 0;
this.NLower = 0;
this.NUpper = 1;
break;
case 'D':
this.Food = 0;
this.NLower = 2;
this.NUpper = 0;
this.nMinPlayer = 3;
break;
case 'E':
this.Food = 0;
this.NLower = 1;
this.NUpper = 1;
break;
case 'F':
this.Food = 0;
this.NLower = 0;
this.NUpper = 2;
break;
case 'G':
this.Food = 0;
this.NLower = 1;
this.NUpper = 2;
this.nMinPlayer = 4;
break;
default:
throw new IllegalArgumentException();
}
this.nMinPlayer = nMinPlayer;
}
// Constructors
// End Constructors
// Functions