Player, Slot, Events added

This commit is contained in:
GabrieleRadice
2026-03-13 20:29:57 +01:00
parent b0b8440d90
commit b879b7401b
9 changed files with 244 additions and 1 deletions
@@ -3,7 +3,7 @@ package it.polimi.ingsw.gc14.Model.Cards.TribeCards;
import it.polimi.ingsw.gc14.Model.Cards.TribeCard;
public abstract class Character extends TribeCard {
private CharacterType type;
private CharacterType type;
public CharacterType getType() {
return type;
}
@@ -0,0 +1,29 @@
package it.polimi.ingsw.gc14.Model.Cards.TribeCards;
import it.polimi.ingsw.gc14.Model.Cards.TribeCard;
import it.polimi.ingsw.gc14.Model.Player;
import java.util.ArrayList;
import javax.smartcardio.Card;
import java.lang.reflect.Array;
public abstract class EventCard extends TribeCard {
// Getters
private EventType type;
public EventType getType() { return type; }
// End getters
// Constructors
public EventCard(int Era, EventType type) {
super(Era);
this.type = type;
}
// End Constructors
// Function
// TODO
public abstract void activateEvent (ArrayList <Player> playerList);
// End Functions
}
@@ -0,0 +1,5 @@
package it.polimi.ingsw.gc14.Model.Cards.TribeCards;
public enum EventType {
SUSTENANCE, SHAMANIC_RITUAL, CAVE_PAINTINGS, HUNT
}
@@ -0,0 +1,18 @@
package it.polimi.ingsw.gc14.Model.Cards.TribeCards.Events;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.EventType;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.EventCard;
import it.polimi.ingsw.gc14.Model.Player;
import java.util.ArrayList;
public class CavePaintings extends EventCard {
public CavePaintings(int Era) {
super(Era, EventType.CAVE_PAINTINGS);
}
// TODO
@Override
public void activateEvent (ArrayList <Player> playerList){
}
}
@@ -0,0 +1,18 @@
package it.polimi.ingsw.gc14.Model.Cards.TribeCards.Events;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.EventType;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.EventCard;
import it.polimi.ingsw.gc14.Model.Player;
import java.util.ArrayList;
public class Hunt extends EventCard {
public Hunt(int Era) {
super(Era, EventType.HUNT);
}
// TODO
@Override
public void activateEvent (ArrayList <Player> playerList){
}
}
@@ -0,0 +1,18 @@
package it.polimi.ingsw.gc14.Model.Cards.TribeCards.Events;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.EventType;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.EventCard;
import it.polimi.ingsw.gc14.Model.Player;
import java.util.ArrayList;
public class ShamanicRitual extends EventCard {
public ShamanicRitual(int Era) {
super(Era, EventType.SHAMANIC_RITUAL);
}
// TODO
@Override
public void activateEvent (ArrayList <Player> playerList){
}
}
@@ -0,0 +1,18 @@
package it.polimi.ingsw.gc14.Model.Cards.TribeCards.Events;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.EventType;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.EventCard;
import it.polimi.ingsw.gc14.Model.Player;
import java.util.ArrayList;
public class Sustenance extends EventCard {
public Sustenance(int Era) {
super(Era, EventType.SUSTENANCE);
}
// TODO
@Override
public void activateEvent (ArrayList <Player> playerList){
}
}
@@ -0,0 +1,100 @@
package it.polimi.ingsw.gc14.Model;
import it.polimi.ingsw.gc14.Model.Cards.BuildingCard;
import it.polimi.ingsw.gc14.Model.Cards.TribeCard;
import java.util.ArrayList;
public class Player {
// Getters
private String UserName;
public String getUserName() {
return UserName;
}
private ArrayList <TribeCard> TribeCards;
public ArrayList <TribeCard> getTribeCards() {
return TribeCards;
}
private ArrayList <BuildingCard> BuildingCards;
public ArrayList <BuildingCard> 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){
this.UserName = UserName;
}
public void setTribeCards(ArrayList <TribeCard> TribeCards){
this.TribeCards = TribeCards;
}
public void setBuildingCards(ArrayList <BuildingCard> BuildingCards){
this.BuildingCards = BuildingCards;
}
public void addFood(int Value){
this.FoodValue += Value;
}
public Boolean removeFood(int Value){
if(Value > this.FoodValue){
return false;
}
this.FoodValue -= Value;
return true;
}
public void addPrestige(int Value){
this.PrestigeValue += Value;
}
// TODO
public void removePrestige(int Value){
// check max/min value (605)
this.PrestigeValue -= Value;
}
// End setters
// Constructors
public Player(String UserName){
this.UserName = UserName;
this.TribeCards = new ArrayList<TribeCard>();
this.BuildingCards = new ArrayList<BuildingCard>();
this.FoodValue = 0;
this.PrestigeValue = 0;
}
// End constructors
// Functions
// TODO
public void Play(Slot slot){
}
// TODO
public void SlotChoice(){
}
// End functions
}
@@ -0,0 +1,37 @@
package it.polimi.ingsw.gc14.Model;
public class Slot {
// Getters
private int NUpper;
public int getNUpper(){
return NUpper;
}
private int NLower;
public int getNLower(){
return NLower;
}
private int Food;
public int getFood(){
return Food;
}
// End getters
// Setters
// End setters
// Constructors
public Slot(int NUpper, int NLower, int Food) throws IllegalArgumentException {
this.NUpper = NUpper;
this.NLower = NLower;
this.Food = Food;
if(Food != 0 && (NUpper != 0 || NLower != 0)){
throw new IllegalArgumentException();
}
}
// End Constructors
// Functions
// End functions
}