Instance of deleted on characters, Changed Building Effect Logic

This commit is contained in:
rubenpirreram
2026-03-17 17:39:00 +01:00
parent c0a02bbeed
commit e98bae5a6e
19 changed files with 77 additions and 175 deletions
@@ -3,6 +3,7 @@ package it.polimi.ingsw.gc14.Model;
import it.polimi.ingsw.gc14.Model.Cards.BuildingCard;
import it.polimi.ingsw.gc14.Model.Cards.TribeCard;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters.*;
import java.util.ArrayList;
@@ -18,6 +19,13 @@ public class Player {
private ArrayList <Character> CharacterCards;
public ArrayList <Character> getCharacterCards() {
ArrayList <Character> copy = new ArrayList <>();
ArrayList<Character> temp = new ArrayList <>();
temp.addAll(artists);
temp.addAll(builders);
temp.addAll(gatherers);
temp.addAll(inventors);
temp.addAll(shamans);
temp.addAll(hunters);
for(Character character:CharacterCards){
copy.add(character.clone());
}
@@ -33,6 +41,13 @@ public class Player {
return copy;
}
public ArrayList <Artist> artists;
public ArrayList <Builder> builders;
public ArrayList <Inventor> inventors;
public ArrayList <Gatherers> gatherers;
public ArrayList <Shaman> shamans;
public ArrayList <Hunter> hunters;
private int FoodValue;
public int getFoodValue() {
return FoodValue;
@@ -52,15 +67,6 @@ public class Player {
// End getters
// Setters
public void setUserName(String UserName) throws IllegalArgumentException{
int max_len = 32;
if(UserName.length() > max_len || UserName.length() == 0){
throw new IllegalArgumentException();
}
this.UserName = UserName;
}
public void addFood(int Value){
this.FoodValue += Value;
}