Add: TribeCard Clone
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package it.polimi.ingsw.gc14.Model.Cards;
|
package it.polimi.ingsw.gc14.Model.Cards;
|
||||||
|
|
||||||
|
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
|
||||||
import it.polimi.ingsw.gc14.Model.PlayableCard;
|
import it.polimi.ingsw.gc14.Model.PlayableCard;
|
||||||
|
|
||||||
public abstract class TribeCard extends PlayableCard {
|
public abstract class TribeCard extends PlayableCard {
|
||||||
@@ -20,4 +21,6 @@ public abstract class TribeCard extends PlayableCard {
|
|||||||
this.nMin=nMin;
|
this.nMin=nMin;
|
||||||
this.isEventCard=isEventCard;
|
this.isEventCard=isEventCard;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public abstract TribeCard clone();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,9 @@ public abstract class EventCard extends TribeCard {
|
|||||||
// End Constructors
|
// End Constructors
|
||||||
|
|
||||||
// Function
|
// Function
|
||||||
// TODO
|
@Override
|
||||||
|
public abstract TribeCard clone();
|
||||||
|
|
||||||
public abstract void activateEvent (ArrayList <Player> playerList);
|
public abstract void activateEvent (ArrayList <Player> playerList);
|
||||||
// End Functions
|
// End Functions
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,4 +42,9 @@ public class CavePaintings extends EventCard {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public EventCard clone()
|
||||||
|
{
|
||||||
|
return new CavePaintings(getEra(), NLower, NPrestigeRem, NPrestigeMul) ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,4 +35,8 @@ public class Hunt extends EventCard {
|
|||||||
player.addPrestige(prestigeMultiplicator * hunterCounter);
|
player.addPrestige(prestigeMultiplicator * hunterCounter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public EventCard clone() {
|
||||||
|
return new Hunt(getEra(), prestigeMultiplicator);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,10 @@ public class ShamanicRitual extends EventCard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public EventCard clone() {
|
||||||
|
return new ShamanicRitual(getEra(), prestigeToAdd, prestigeToRemove);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,4 +51,8 @@ public class Sustenance extends EventCard {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public EventCard clone() {
|
||||||
|
return new Sustenance(getEra(), PrestigeDebt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,30 @@ public class Game {
|
|||||||
private OrderLogicCard orderLogicCard;
|
private OrderLogicCard orderLogicCard;
|
||||||
private Board board;
|
private Board board;
|
||||||
|
|
||||||
public int getnPlayers() {
|
public Player getPlayerByIndex(int playerIndex) throws IndexOutOfBoundsException {
|
||||||
|
if(playerIndex >= playersList.size())
|
||||||
|
throw new IndexOutOfBoundsException("Player index out of bounds");
|
||||||
|
return playersList.get(playerIndex);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
public TribeCard getUpperTribeCardByIndex(int playerIndex) throws IndexOutOfBoundsException
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public TribeCard getLowerTribeCardByIndex()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public BuildingCard getUpperBuildingCardByIndex(int playerIndex) throws IndexOutOfBoundsException
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public BuildingCard getLowerBuildingCardByIndex(int playerIndex) throws IndexOutOfBoundsException
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
public int getNPlayers() {
|
||||||
return nPlayers;
|
return nPlayers;
|
||||||
}
|
}
|
||||||
public Game(int nPlayers) {
|
public Game(int nPlayers) {
|
||||||
|
|||||||
Reference in New Issue
Block a user