Refactor: Gatherers->Gatherer

This commit is contained in:
rubenpirreram
2026-03-20 19:07:59 +01:00
parent d80c2888ee
commit 0e9a4781bb
8 changed files with 24 additions and 28 deletions
@@ -4,16 +4,16 @@ import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
import it.polimi.ingsw.gc14.Model.Player;
public class Gatherers extends Character {
public class Gatherer extends Character {
/**
*
* @param Era gatherers era
*/
public Gatherers(int Era) {
public Gatherer(int Era) {
super(Era, CharacterType.GATHERERS);
}
public Gatherers(int Era,int nMin) {
public Gatherer(int Era, int nMin) {
super(Era, CharacterType.GATHERERS,nMin);
}
@Override
@@ -23,7 +23,7 @@ public class Gatherers extends Character {
@Override
public Character clone() {
return new Gatherers(getEra());
return new Gatherer(getEra());
}
public void insert(Player player) {
player.gatherers.add(this);
@@ -1,10 +1,8 @@
package it.polimi.ingsw.gc14.Model;
import com.google.gson.*;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters.*;
import it.polimi.ingsw.gc14.Model.Cards.TribeCard;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.EventType;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Events.CavePaintings;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Events.Hunt;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Events.ShamanicRitual;
@@ -61,10 +59,10 @@ public class DecksCreator {
case 3 -> new Builder(era, p[0], p[1], p[2]);
default -> throw new IllegalArgumentException("Builder: parametri non validi");
};
case "Gatherers" -> switch (p.length) {
case 0 -> new Gatherers(era);
case 1 -> new Gatherers(era, p[0]);
default -> throw new IllegalArgumentException("Gatherers: parametri non validi");
case "Gatherer" -> switch (p.length) {
case 0 -> new Gatherer(era);
case 1 -> new Gatherer(era, p[0]);
default -> throw new IllegalArgumentException("Gatherer: parametri non validi");
};
case "Artist" -> switch (p.length) {
case 0 -> new Artist(era);
@@ -37,7 +37,7 @@ public class Player {
public ArrayList <Artist> artists;
public ArrayList <Builder> builders;
public ArrayList <Inventor> inventors;
public ArrayList <Gatherers> gatherers;
public ArrayList <Gatherer> gatherers;
public ArrayList <Shaman> shamans;
public ArrayList <Hunter> hunters;
+4 -4
View File
@@ -81,21 +81,21 @@
},
{
"isEvent": false,
"type": "Gatherers",
"type": "Gatherer",
"era": 1,
"armed": false,
"params": []
},
{
"isEvent": false,
"type": "Gatherers",
"type": "Gatherer",
"era": 1,
"armed": false,
"params": []
},
{
"isEvent": false,
"type": "Gatherers",
"type": "Gatherer",
"era": 1,
"armed": false,
"params": [
@@ -104,7 +104,7 @@
},
{
"isEvent": false,
"type": "Gatherers",
"type": "Gatherer",
"era": 1,
"armed": false,
"params": [
+4 -4
View File
@@ -88,14 +88,14 @@
},
{
"isEvent": false,
"type": "Gatherers",
"type": "Gatherer",
"era": 2,
"armed": false,
"params": []
},
{
"isEvent": false,
"type": "Gatherers",
"type": "Gatherer",
"era": 2,
"armed": false,
"params": [
@@ -104,7 +104,7 @@
},
{
"isEvent": false,
"type": "Gatherers",
"type": "Gatherer",
"era": 2,
"armed": false,
"params": [
@@ -113,7 +113,7 @@
},
{
"isEvent": false,
"type": "Gatherers",
"type": "Gatherer",
"era": 2,
"armed": false,
"params": [
+3 -3
View File
@@ -72,7 +72,7 @@
},
{
"isEvent": false,
"type": "Gatherers",
"type": "Gatherer",
"era": 3,
"armed": false,
"params": [
@@ -81,7 +81,7 @@
},
{
"isEvent": false,
"type": "Gatherers",
"type": "Gatherer",
"era": 3,
"armed": false,
"params": [
@@ -90,7 +90,7 @@
},
{
"isEvent": false,
"type": "Gatherers",
"type": "Gatherer",
"era": 3,
"armed": false,
"params": []