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 java.util.ArrayList; import static java.lang.Math.abs; public class Player { // Getters private String UserName; public String getUserName() { return UserName; } private ArrayList CharacterCards; public ArrayList getCharacterCards() { ArrayList copy = new ArrayList <>(); for(Character character:CharacterCards){ copy.add(character.clone()); } return copy; } private ArrayList BuildingCards; public ArrayList getBuildingCards() { return BuildingCards; } private int FoodValue; public int getFoodValue() { return FoodValue; } private int PrestigeValue; public int getPrestigeValue() { return PrestigeValue; } /* TODO * private Game game; * public Game getGame(){ * return Game; * } */ // 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; } // TODO, chiedere prof (throws IllegalArgument) public Boolean removeFood(int Value){ // Value = abs(Value); chiedere prof if(Value > this.FoodValue){ return false; } this.FoodValue -= Value; return true; } public void addPrestige(int Value){ this.PrestigeValue += Value; } public void removePrestige(int Value){ this.PrestigeValue -= Value; } // End setters // Constructors public Player(String UserName){ this.UserName = UserName; this.CharacterCards = new ArrayList(); this.BuildingCards = new ArrayList(); this.FoodValue = 0; this.PrestigeValue = 0; } // End constructors // Functions // TODO public void Play(Slot slot){ } // TODO public void SlotChoice(){ } // End functions }